{"success":true,"data":{"ext":"c","name":"C","description":"C is a source code file format for the C programming language, originally developed by Dennis Ritchie at Bell Labs and standardized today by ISO/IEC and ANSI. It is used to store program source for systems software, embedded firmware, utilities, and other compiled applications. C source files are plain text and generally safe, though they can contain arbitrary code that becomes a security concern when compiled or executed from untrusted sources.","mime":["text/x-csrc"],"risk_level":"Safe","signatures":[{"hex":"23 69 6E 63 6C 75 64 65 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"}]}],"related":["h","m"],"usage":{"python":"def is_c(file_path: str) -> bool:\n    \"\"\"Check if file is a valid C by magic bytes.\"\"\"\n    signature = bytes([0x23, 0x69, 0x6E, 0x63, 0x6C, 0x75, 0x64, 0x65, 0x20])\n    with open(file_path, \"rb\") as f:\n        return f.read(9) == signature","node":"function isC(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x23, 0x69, 0x6E, 0x63, 0x6C, 0x75, 0x64, 0x65, 0x20]);\n  return buffer.subarray(0, 9).equals(signature);\n}","go":"func IsC(data []byte) bool {\n    signature := []byte{0x23, 0x69, 0x6E, 0x63, 0x6C, 0x75, 0x64, 0x65, 0x20}\n    if len(data) < 9 {\n        return false\n    }\n    return bytes.Equal(data[:9], signature)\n}"},"category":"Source Code"}}