{"success":true,"data":{"ext":"7z","name":"7Z","description":"7Z is a compressed archive file format developed by Igor Pavlov and maintained through the 7-Zip project. It is used to store one or more files in a single container for backup, distribution, and general file compression, and is supported by 7-Zip and many other archiving utilities. It is generally safe to handle, though archive contents should still be reviewed before extraction because compressed files can contain unwanted or malicious payloads.","mime":["application/x-7z-compressed"],"risk_level":"Safe","signatures":[{"hex":"37 7A","offset":0,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]}],"related":["ace","arj","bz","bz2","cab","cpio"],"usage":{"python":"def is_7z(file_path: str) -> bool:\n    \"\"\"Check if file is a valid 7Z by magic bytes.\"\"\"\n    signature = bytes([0x37, 0x7A])\n    with open(file_path, \"rb\") as f:\n        return f.read(2) == signature","node":"function is7Z(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x37, 0x7A]);\n  return buffer.subarray(0, 2).equals(signature);\n}","go":"func Is7Z(data []byte) bool {\n    signature := []byte{0x37, 0x7A}\n    if len(data) < 2 {\n        return false\n    }\n    return bytes.Equal(data[:2], signature)\n}"},"category":"Archives"}}