{"success":true,"data":{"ext":"diff","name":"DIFF","description":"The DIFF format is a plain-text patch format for representing changes between file versions, originating from Unix diff utilities and maintained through widely used editor, version-control, and patching tools. It is used to review source code changes, exchange patches, and apply modifications across software development workflows. As text data, it is generally safe, though malformed patches can cause unexpected edits when applied to untrusted targets.","mime":["text/x-diff"],"risk_level":"Safe","signatures":[{"hex":"64 69 66 66 20","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":"2A 2A 2A 20","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":"4F 6E 6C 79 20 69 6E 20","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":"43 6F 6D 6D 6F 6E 20 73 75 62 64 69 72 65 63 74 6F 72 69 65 73 3A 20","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":"49 6E 64 65 78 3A","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":["patch"],"usage":{"python":"def is_diff(file_path: str) -> bool:\n    \"\"\"Check if file is a valid DIFF by magic bytes.\"\"\"\n    signature = bytes([0x64, 0x69, 0x66, 0x66, 0x20])\n    with open(file_path, \"rb\") as f:\n        return f.read(5) == signature","node":"function isDIFF(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x64, 0x69, 0x66, 0x66, 0x20]);\n  return buffer.subarray(0, 5).equals(signature);\n}","go":"func IsDIFF(data []byte) bool {\n    signature := []byte{0x64, 0x69, 0x66, 0x66, 0x20}\n    if len(data) < 5 {\n        return false\n    }\n    return bytes.Equal(data[:5], signature)\n}"}}}