A version-1 shared message (HDF5 1.6) embeds the target as a symbol-table entry: after six reserved bytes comes a length-sized local-heap offset, then the object header address. We read the heap offset as the address, so datasets using a committed datatype in 1.6-era files (tcompound.h5, tcompound2.h5) failed with InvalidObjectHeaderVersion. parse_shared_ref now takes length_size and skips the offset, as libhdf5 does. Resolving a reference also no longer falls back to the first message of any type in the target header: a missing target message is SharedMessageTargetMissing instead of garbage. Fixture: tcompound.h5 from libhdf5's tools/test/testfiles (8 KiB). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
clawhdf5-format
Pure-Rust HDF5 binary format parsing and writing — no C dependencies.
Features
- Zero-copy superblock, object header, and B-tree parsing
- Chunked dataset read/write with filter pipelines
no_stdsupport (disablestdfeature)- Optional parallel reads via Rayon
- SHA-256 provenance tracking
Usage
use clawhdf5_format::Superblock;
let data = std::fs::read("data.h5").unwrap();
let sb = Superblock::from_bytes(&data).unwrap();
println!("HDF5 version {}.{}", sb.version_major(), sb.version_minor());
License
MIT