{"success":true,"data":{"ext":"lzh","name":"Compressed archive file","description":"LZH is a compressed archive file format associated with the Lempel-Ziv-Huffman family and originally developed by Haruyasu Yoshizaki for the LHarc archiver. It was used to distribute software, documents, and bundled files on Unix and Japanese systems, and some tools still extract it today. As a legacy format, it is largely obsolete, but archives can still appear in older software collections and should be handled cautiously from untrusted sources.","mime":["application/x-lzh-compressed"],"risk_level":"Safe","signatures":[{"hex":"2D 6C 68 30 2D","offset":2,"sources":[{"name":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"}]},{"hex":"2D 6C 68 35 2D","offset":2,"sources":[{"name":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"}]},{"hex":"2D 6C 68","offset":2,"sources":[{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"}]}],"related":["lha","7z","ace","arj","bz","bz2"],"usage":{"python":"def is_lzh(file_path: str) -> bool:\n    \"\"\"Check if file is a valid LZH by magic bytes at offset 2.\"\"\"\n    signature = bytes([0x2D, 0x6C, 0x68, 0x30, 0x2D])\n    with open(file_path, \"rb\") as f:\n        f.seek(2)\n        return f.read(5) == signature","node":"function isLZH(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x2D, 0x6C, 0x68, 0x30, 0x2D]);\n  if (buffer.length < 7) return false;\n  return buffer.subarray(2, 7).equals(signature);\n}","go":"func IsLZH(data []byte) bool {\n    signature := []byte{0x2D, 0x6C, 0x68, 0x30, 0x2D}\n    if len(data) < 7 {\n        return false\n    }\n    return bytes.Equal(data[2:7], signature)\n}"},"category":"Archives"}}