{"success":true,"data":{"ext":"rtf","name":"Rich text format word processing file","description":"Rich Text Format (RTF) is a document file format created by Microsoft for exchanging formatted text between word processors and other applications. It is commonly used for letters, reports, resumes, and simple documents, and is supported by Microsoft Word, LibreOffice, Apple TextEdit, and many email and editing tools. RTF is a legacy format with limited formatting compared with modern document standards, and files from untrusted sources should still be opened with caution.","mime":["application/rtf"],"risk_level":"Safe","signatures":[{"hex":"7B 5C 72 74 66","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"}]},{"hex":"7B 5C 72 74 66 31","offset":0,"sources":[{"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/RichTextFormat.cs"}]}],"related":["odt","ott","wpd","wps","doc","docx"],"usage":{"python":"def is_rtf(file_path: str) -> bool:\n    \"\"\"Check if file is a valid RTF by magic bytes.\"\"\"\n    signature = bytes([0x7B, 0x5C, 0x72, 0x74, 0x66])\n    with open(file_path, \"rb\") as f:\n        return f.read(5) == signature","node":"function isRTF(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x7B, 0x5C, 0x72, 0x74, 0x66]);\n  return buffer.subarray(0, 5).equals(signature);\n}","go":"func IsRTF(data []byte) bool {\n    signature := []byte{0x7B, 0x5C, 0x72, 0x74, 0x66}\n    if len(data) < 5 {\n        return false\n    }\n    return bytes.Equal(data[:5], signature)\n}"},"category":"Office"}}