{"success":true,"data":{"ext":"cpio","name":"CPIO","description":"CPIO is a Unix archive file format originally created for early System V and now maintained as part of POSIX and related Unix toolchains. It is used to package files for backups, software distribution, initramfs images, and other archival or transfer tasks. The format is a legacy standard with simple structure; archives from untrusted sources should still be handled carefully because they may contain unexpected paths or overwrite files during extraction.","mime":["application/x-cpio"],"risk_level":"Safe","signatures":[{"hex":"30 37 30 37 30 37","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":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"}]},{"hex":"30 37 30 37 30 31","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":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"}]},{"hex":"30 37 30 37 30 32","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":"Wikipedia","url":"https://en.wikipedia.org/wiki/List_of_file_signatures"}]}],"related":["7z","ace","arj","bz","bz2","cab"],"usage":{"python":"def is_cpio(file_path: str) -> bool:\n    \"\"\"Check if file is a valid CPIO by magic bytes.\"\"\"\n    signature = bytes([0x30, 0x37, 0x30, 0x37, 0x30, 0x37])\n    with open(file_path, \"rb\") as f:\n        return f.read(6) == signature","node":"function isCPIO(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x30, 0x37, 0x30, 0x37, 0x30, 0x37]);\n  return buffer.subarray(0, 6).equals(signature);\n}","go":"func IsCPIO(data []byte) bool {\n    signature := []byte{0x30, 0x37, 0x30, 0x37, 0x30, 0x37}\n    if len(data) < 6 {\n        return false\n    }\n    return bytes.Equal(data[:6], signature)\n}"},"category":"Archives"}}