{"success":true,"data":{"ext":"lha","name":"Compressed archive file","description":"LHA is a compressed archive file format originally developed by Haruyasu Yoshizaki and later supported by various open-source implementations. It is used for packaging multiple files into a single archive, reducing storage use and simplifying distribution on legacy systems, especially in Japanese computing environments and older software collections. The format is now largely considered legacy; as with other archives, files from untrusted sources should be opened with caution because they may contain harmful content.","mime":["application/x-lzh-compressed"],"risk_level":"Safe","signatures":[{"hex":"2D 6C 68","offset":2,"sources":[{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"}]}],"related":["lzh","7z","ace","arj","bz","bz2"],"usage":{"python":"def is_lha(file_path: str) -> bool:\n    \"\"\"Check if file is a valid LHA by magic bytes at offset 2.\"\"\"\n    signature = bytes([0x2D, 0x6C, 0x68])\n    with open(file_path, \"rb\") as f:\n        f.seek(2)\n        return f.read(3) == signature","node":"function isLHA(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x2D, 0x6C, 0x68]);\n  if (buffer.length < 5) return false;\n  return buffer.subarray(2, 5).equals(signature);\n}","go":"func IsLHA(data []byte) bool {\n    signature := []byte{0x2D, 0x6C, 0x68}\n    if len(data) < 5 {\n        return false\n    }\n    return bytes.Equal(data[2:5], signature)\n}"},"category":"Archives"}}