{"success":true,"data":{"ext":"rar","name":"Rar4","description":"RAR is a compressed archive format created by Eugene Roshal and maintained by RARLAB. It is used to package and compress files for backups, distribution, and multi-volume archives in archiving tools such as WinRAR and compatible extractors. RAR4 is an older revision of the format, but it is generally safe to open; as with any archive, files from untrusted sources should be scanned before extraction.","mime":["application/vnd.rar","application/x-rar-compressed"],"risk_level":"Safe","signatures":[{"hex":"52 61 72 21 1A 07 00","offset":0,"sources":[{"name":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"},{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"},{"name":"Neil Harvey FileSignatures","url":"https://raw.githubusercontent.com/neilharvey/FileSignatures/master/src/FileSignatures/Formats/Rar4.cs"}]},{"hex":"52 61 72 21 1A 07 01 00","offset":0,"sources":[{"name":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"},{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"},{"name":"Neil Harvey FileSignatures","url":"https://raw.githubusercontent.com/neilharvey/FileSignatures/master/src/FileSignatures/Formats/Rar5.cs"}]},{"hex":"52 61 72 21","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"}]},{"hex":"52 61 72 21 1A","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":["7z","ace","arj","bz","bz2","cab"],"usage":{"python":"def is_rar(file_path: str) -> bool:\n    \"\"\"Check if file is a valid RAR by magic bytes.\"\"\"\n    signature = bytes([0x52, 0x61, 0x72, 0x21, 0x1A, 0x07, 0x00])\n    with open(file_path, \"rb\") as f:\n        return f.read(7) == signature","node":"function isRAR(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x52, 0x61, 0x72, 0x21, 0x1A, 0x07, 0x00]);\n  return buffer.subarray(0, 7).equals(signature);\n}","go":"func IsRAR(data []byte) bool {\n    signature := []byte{0x52, 0x61, 0x72, 0x21, 0x1A, 0x07, 0x00}\n    if len(data) < 7 {\n        return false\n    }\n    return bytes.Equal(data[:7], signature)\n}"},"category":"Archives"}}