{"success":true,"data":{"ext":"patch","name":"PATCH","description":"PATCH is a plain-text file format for describing line-based changes between versions of a file, originating with Unix diff and patch utilities and now commonly handled by POSIX and GNU toolchains. It is used to distribute source code fixes, configuration updates, and other incremental edits, allowing developers and maintainers to apply changes to text files in a reproducible way. Because it contains only text instructions, the format is generally safe to inspect, though applying an untrusted patch can still modify files unexpectedly.","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":["diff"],"usage":{"python":"def is_patch(file_path: str) -> bool:\n    \"\"\"Check if file is a valid PATCH 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 isPATCH(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x64, 0x69, 0x66, 0x66, 0x20]);\n  return buffer.subarray(0, 5).equals(signature);\n}","go":"func IsPATCH(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}"}}}