H4
application/octet-stream
Magic Bytes
Offset: 0
0E 03 13 01
Hierarchical Data Format version 4 (HDF4) is a self-describing scientific data format originally developed by the National Center for Supercomputing Applications (NCSA) and currently maintained by The HDF Group. It is designed to store and organize complex multidimensional arrays, raster images, and metadata commonly utilized in earth science, climatology, and satellite imagery analysis. Although primarily considered a legacy standard succeeded by HDF5, it remains in active use for archival scientific datasets and poses minimal security risks during standard processing.
Validation Code
How to validate .h4 files in Python
Python
def is_h4(file_path: str) -> bool:
"""Check if file is a valid H4 by magic bytes."""
signature = bytes([0x0E, 0x03, 0x13, 0x01])
with open(file_path, "rb") as f:
return f.read(4) == signature
How to validate .h4 files in Node.js
Node.js
function isH4(buffer: Buffer): boolean {
const signature = Buffer.from([0x0E, 0x03, 0x13, 0x01]);
return buffer.subarray(0, 4).equals(signature);
}
Go
func IsH4(data []byte) bool {
signature := []byte{0x0E, 0x03, 0x13, 0x01}
if len(data) < 4 {
return false
}
return bytes.Equal(data[:4], signature)
}
API Endpoint
GET
/api/v1/h4
curl https://filesignature.org/api/v1/h4