{"success":true,"data":{"ext":"tar","name":"Tape Archive file","description":"Tape Archive (tar) is a file archive format originally developed for Unix systems by AT&T Bell Labs and maintained through widely implemented specifications and tools such as POSIX and GNU tar. It is used to bundle multiple files and directories into a single archive for software distribution, backups, and data transfer, often in combination with compression tools. The format is generally safe, though archives from untrusted sources should still be inspected for path traversal or overwrite risks when extracted.","mime":["application/x-tar"],"risk_level":"Safe","signatures":[{"hex":"75 73 74 61 72 00","offset":257,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]},{"hex":"75 73 74 61 72 00 30 30","offset":257,"sources":[{"name":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"}]},{"hex":"75 73 74 61 72 20 20 00","offset":257,"sources":[{"name":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"}]},{"hex":"75 73 74 61 72","offset":257,"sources":[{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"}]},{"hex":"75 73 74 61 72","offset":0,"sources":[{"name":"Neil Harvey FileSignatures","url":"https://raw.githubusercontent.com/neilharvey/FileSignatures/master/src/FileSignatures/Formats/Tar.cs"}]}],"related":["7z","ace","arj","bz","bz2","cab"],"usage":{"python":"def is_tar(file_path: str) -> bool:\n    \"\"\"Check if file is a valid TAR by magic bytes at offset 257.\"\"\"\n    signature = bytes([0x75, 0x73, 0x74, 0x61, 0x72, 0x00])\n    with open(file_path, \"rb\") as f:\n        f.seek(257)\n        return f.read(6) == signature","node":"function isTAR(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x75, 0x73, 0x74, 0x61, 0x72, 0x00]);\n  if (buffer.length < 263) return false;\n  return buffer.subarray(257, 263).equals(signature);\n}","go":"func IsTAR(data []byte) bool {\n    signature := []byte{0x75, 0x73, 0x74, 0x61, 0x72, 0x00}\n    if len(data) < 263 {\n        return false\n    }\n    return bytes.Equal(data[257:263], signature)\n}"},"category":"Archives"}}