HDF5 (.hdf5)
.hdf5 file signature | application/octet-stream
Data stored in version 5 of theHierarchical Data Format.
Magic Bytes
Offset 0
89 48 44 46 0D 0A 1A 0A
Sources: Wikipedia
Extension
.hdf5
MIME Type
application/octet-stream
Byte Offset
0
Risk Level
Safe
Validation Code
How to validate .hdf5 files in Python
def is_hdf5(file_path: str) -> bool:
"""Check if file is a valid HDF5 by magic bytes."""
signature = bytes([0x89, 0x48, 0x44, 0x46, 0x0D, 0x0A, 0x1A, 0x0A])
with open(file_path, "rb") as f:
return f.read(8) == signature
How to validate .hdf5 files in Node.js
function isHDF5(buffer: Buffer): boolean {
const signature = Buffer.from([0x89, 0x48, 0x44, 0x46, 0x0D, 0x0A, 0x1A, 0x0A]);
return buffer.subarray(0, 8).equals(signature);
}
How to validate .hdf5 files in Go
func IsHDF5(data []byte) bool {
signature := []byte{0x89, 0x48, 0x44, 0x46, 0x0D, 0x0A, 0x1A, 0x0A}
if len(data) < 8 {
return false
}
return bytes.Equal(data[:8], signature)
}
API Endpoint
/api/v1/hdf5
curl https://filesignature.org/api/v1/hdf5
See the full API documentation for all endpoints and parameters.
Frequently Asked Questions
What is a .hdf5 file?
A .hdf5 file is a HDF5 file. Data stored in version 5 of theHierarchical Data Format.
What are the magic bytes for .hdf5 files?
The magic bytes for HDF5 files are 89 48 44 46 0D 0A 1A 0A at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.
How do I validate a .hdf5 file?
To validate a .hdf5 file, read the first bytes of the file and compare them against the known magic bytes (89 48 44 46 0D 0A 1A 0A) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.
What is the MIME type for .hdf5 files?
There is no officially registered MIME type for .hdf5 files. Systems typically use application/octet-stream as a generic fallback when handling this format.
Is it safe to open .hdf5 files?
HDF5 (.hdf5) files are generally safe to open. They are classified as low risk because they primarily contain data rather than executable code. However, always ensure files come from a trusted source.