{"success":true,"data":{"ext":"gz","name":"GZIP archive file","description":"GZIP archive file is a compressed data format originally designed by Jean-loup Gailly and Mark Adler and commonly maintained through the GNU gzip implementation. It is used to reduce file size for software distributions, log files, and data transfer, and is often paired with tar for packaging multiple files. The format is generally safe, though decompression bombs and corrupted archives can consume excessive resources or fail during extraction.","mime":["application/gzip"],"risk_level":"Safe","signatures":[{"hex":"1F 8B","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"},{"name":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"},{"name":"Neil Harvey FileSignatures","url":"https://raw.githubusercontent.com/neilharvey/FileSignatures/master/src/FileSignatures/Formats/Gzip.cs"}]},{"hex":"1F 8B 08","offset":0,"sources":[{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"}]}],"related":["tgz","7z","ace","arj","bz","bz2"],"usage":{"python":"def is_gz(file_path: str) -> bool:\n    \"\"\"Check if file is a valid GZ by magic bytes.\"\"\"\n    signature = bytes([0x1F, 0x8B])\n    with open(file_path, \"rb\") as f:\n        return f.read(2) == signature","node":"function isGZ(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x1F, 0x8B]);\n  return buffer.subarray(0, 2).equals(signature);\n}","go":"func IsGZ(data []byte) bool {\n    signature := []byte{0x1F, 0x8B}\n    if len(data) < 2 {\n        return false\n    }\n    return bytes.Equal(data[:2], signature)\n}"},"category":"Archives"}}