{"success":true,"data":{"ext":"onetoc2","name":"ONETOC2","description":"ONETOC2 is a Microsoft OneNote table of contents file maintained by Microsoft as part of the OneNote application format. It stores notebook metadata and section references used by OneNote to organize and synchronize notebook contents across devices. The format is generally safe, though as with other Office-related files, users should open it only from trusted sources and keep their software updated to reduce the risk of handling malformed or malicious files.","mime":["application/onenote;format=onetoc2"],"risk_level":"Safe","signatures":[{"hex":"43 FF 2F A1","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":["onetoc"],"usage":{"python":"def is_onetoc2(file_path: str) -> bool:\n    \"\"\"Check if file is a valid ONETOC2 by magic bytes.\"\"\"\n    signature = bytes([0x43, 0xFF, 0x2F, 0xA1])\n    with open(file_path, \"rb\") as f:\n        return f.read(4) == signature","node":"function isONETOC2(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x43, 0xFF, 0x2F, 0xA1]);\n  return buffer.subarray(0, 4).equals(signature);\n}","go":"func IsONETOC2(data []byte) bool {\n    signature := []byte{0x43, 0xFF, 0x2F, 0xA1}\n    if len(data) < 4 {\n        return false\n    }\n    return bytes.Equal(data[:4], signature)\n}"}}}