{"success":true,"data":{"ext":"mhtml","name":"MHTML","description":"MHTML (MIME HTML) is a web archive format standardized by the IETF and supported by web browsers and email clients to package an HTML document with its related resources in a single file. It is used for saving complete web pages, distributing archived content, and exchanging message-based HTML documents. Because it can include embedded resources and active content, files from untrusted sources should be opened with caution; the format is now largely legacy.","mime":["multipart/related"],"risk_level":"Safe","signatures":[{"hex":"4D 49 4D 45 2D 56 65 72 73 69 6F 6E 3A 20 31 2E 30","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":["mht"],"usage":{"python":"def is_mhtml(file_path: str) -> bool:\n    \"\"\"Check if file is a valid MHTML by magic bytes.\"\"\"\n    signature = bytes([0x4D, 0x49, 0x4D, 0x45, 0x2D, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x3A, 0x20, 0x31, 0x2E, 0x30])\n    with open(file_path, \"rb\") as f:\n        return f.read(17) == signature","node":"function isMHTML(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x4D, 0x49, 0x4D, 0x45, 0x2D, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x3A, 0x20, 0x31, 0x2E, 0x30]);\n  return buffer.subarray(0, 17).equals(signature);\n}","go":"func IsMHTML(data []byte) bool {\n    signature := []byte{0x4D, 0x49, 0x4D, 0x45, 0x2D, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x3A, 0x20, 0x31, 0x2E, 0x30}\n    if len(data) < 17 {\n        return false\n    }\n    return bytes.Equal(data[:17], signature)\n}"}}}