CALS raster bitmap file
application/octet-stream
Magic Bytes
Offset: 0
54 48 50 00
CALS raster bitmap is a standard graphics format developed by the United States Department of Defense for the digitization and storage of military documentation. It is primarily utilized for managing monochrome engineering drawings, architectural blueprints, and technical illustrations within aerospace and government data interchange systems. As a legacy format largely superseded by TIFF and PDF, it remains relevant in historical CAD archives and presents negligible security risks due to its rigid, non-executable structure.
Validation Code
How to validate .cal files in Python
Python
def is_cal(file_path: str) -> bool:
"""Check if file is a valid CAL by magic bytes."""
signature = bytes([0x54, 0x48, 0x50, 0x00])
with open(file_path, "rb") as f:
return f.read(4) == signature
How to validate .cal files in Node.js
Node.js
function isCAL(buffer: Buffer): boolean {
const signature = Buffer.from([0x54, 0x48, 0x50, 0x00]);
return buffer.subarray(0, 4).equals(signature);
}
Go
func IsCAL(data []byte) bool {
signature := []byte{0x54, 0x48, 0x50, 0x00}
if len(data) < 4 {
return false
}
return bytes.Equal(data[:4], signature)
}
API Endpoint
GET
/api/v1/cal
curl https://filesignature.org/api/v1/cal