{"success":true,"data":{"ext":"mobi","name":"MOBI","description":"Mobipocket eBook (MOBI) is an ebook file format created by Mobipocket and later supported by Amazon for Kindle devices and applications. It is used for distributing digital books, magazines, and other reflowable text content that can be read in ebook readers and mobile apps. The format is now largely legacy, as Amazon has shifted to newer Kindle formats, but MOBI files remain common in older libraries; like other ebooks, they are generally safe to open from trusted sources.","mime":["application/x-mobipocket-ebook"],"risk_level":"Safe","signatures":[{"hex":"42 4F 4F 4B 4D 4F 42 49","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":["prc","eps","epub","oxps","pdf","ps"],"usage":{"python":"def is_mobi(file_path: str) -> bool:\n    \"\"\"Check if file is a valid MOBI by magic bytes.\"\"\"\n    signature = bytes([0x42, 0x4F, 0x4F, 0x4B, 0x4D, 0x4F, 0x42, 0x49])\n    with open(file_path, \"rb\") as f:\n        return f.read(8) == signature","node":"function isMOBI(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x42, 0x4F, 0x4F, 0x4B, 0x4D, 0x4F, 0x42, 0x49]);\n  return buffer.subarray(0, 8).equals(signature);\n}","go":"func IsMOBI(data []byte) bool {\n    signature := []byte{0x42, 0x4F, 0x4F, 0x4B, 0x4D, 0x4F, 0x42, 0x49}\n    if len(data) < 8 {\n        return false\n    }\n    return bytes.Equal(data[:8], signature)\n}"},"category":"eBooks"}}