{"success":true,"data":{"ext":"torrent","name":"Torrent file","description":"Torrent files are metadata files used by the BitTorrent peer-to-peer protocol, originally introduced by Bram Cohen and maintained through the BitTorrent specification ecosystem. They are used by BitTorrent clients to locate content, coordinate downloads, and verify file pieces for software distribution, media sharing, and other large transfers. The format is generally safe, though torrents may reference untrusted content, and files obtained through them can expose users to copyright, privacy, or malware risks.","mime":["application/x-bittorrent"],"risk_level":"Safe","signatures":[{"hex":"64 38 3A 61 6E 6E 6F 75 6E 63 65","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":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"}]}],"related":[],"usage":{"python":"def is_torrent(file_path: str) -> bool:\n    \"\"\"Check if file is a valid TORRENT by magic bytes.\"\"\"\n    signature = bytes([0x64, 0x38, 0x3A, 0x61, 0x6E, 0x6E, 0x6F, 0x75, 0x6E, 0x63, 0x65])\n    with open(file_path, \"rb\") as f:\n        return f.read(11) == signature","node":"function isTORRENT(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x64, 0x38, 0x3A, 0x61, 0x6E, 0x6E, 0x6F, 0x75, 0x6E, 0x63, 0x65]);\n  return buffer.subarray(0, 11).equals(signature);\n}","go":"func IsTORRENT(data []byte) bool {\n    signature := []byte{0x64, 0x38, 0x3A, 0x61, 0x6E, 0x6E, 0x6F, 0x75, 0x6E, 0x63, 0x65}\n    if len(data) < 11 {\n        return false\n    }\n    return bytes.Equal(data[:11], signature)\n}"}}}