{"success":true,"data":{"ext":"nc","name":"NetCDF (classic format, CDF-1)","description":"NetCDF (classic format, CDF-1) is a scientific data file format developed and maintained by Unidata, part of the University Corporation for Atmospheric Research. It is used to store array-oriented data in meteorology, oceanography, climate research, and other earth sciences, and is supported by many analysis tools and programming libraries. The format is generally safe; however, as with any data file, malformed or specially crafted files may cause issues in poorly implemented readers.","mime":["application/x-netcdf"],"risk_level":"Safe","signatures":[{"hex":"43 44 46 01","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":"43 44 46 02","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":"00 6D 02","offset":0,"sources":[{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"}]},{"hex":"00 6D 03","offset":0,"sources":[{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"}]},{"hex":"43 44 46","offset":0,"sources":[{"name":"Gary Kessler","url":"https://www.garykessler.net/library/file_sigs_GCK_latest.html"}]}],"related":["cdf"],"usage":{"python":"def is_nc(file_path: str) -> bool:\n    \"\"\"Check if file is a valid NC by magic bytes.\"\"\"\n    signature = bytes([0x43, 0x44, 0x46, 0x01])\n    with open(file_path, \"rb\") as f:\n        return f.read(4) == signature","node":"function isNC(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x43, 0x44, 0x46, 0x01]);\n  return buffer.subarray(0, 4).equals(signature);\n}","go":"func IsNC(data []byte) bool {\n    signature := []byte{0x43, 0x44, 0x46, 0x01}\n    if len(data) < 4 {\n        return false\n    }\n    return bytes.Equal(data[:4], signature)\n}"}}}