我在编写一个程序来验证HDF5版本2文件的超级块中的校验和时遇到了问题。我没有使用HDF5软件,但我的代码中有一个H5_checksum_fletcher32副本(来自HDF5 H5checksum.c)。
我可以假设文件签名块在位置0。
我的逻辑是:
Let offset = the value of byte 9 of the file.
The superblock spans bytes 0 to (15+4*offset).
The last 4 bytes are the checksum as an unsigned int.
The checksum should equal H5_checksum_fletcher32 applied to bytes 0 to (11+4*offset).
我已经将这个逻辑应用于来自NOAA的几个测试文件,我认为它们是可靠的,但校验和永远不会与H5_checksum_fletcher32的结果匹配。超级块中的其他值似乎是正确的。有人能看到我逻辑上的缺陷吗?
发布于 2014-08-14 17:46:40
从HDF5 file format specification
使用Jenkins' lookup3算法计算格式中使用的所有校验和。
这在H5checksum.c
中以H5_checksum_lookup3()
的形式提供。
实际上,似乎应该调用的正确例程是H5_checksum_metadata()
,但这只是使用宏调用H5_checksum_lookup3()
。
https://stackoverflow.com/questions/25299097
复制相似问题