Ask HN: How do you choose a checksum algorithm for serialized datastructures?
I'm building a library that serializes blocks of data to disk in 4MB~ or so increments. What would be a sufficient number of bits to allocate for checksums (ie. CRC32, CRC64, MD5, etc.) on those blocks such that corruption, torn writes, etc. can be found?
4 comments
[ 3.9 ms ] story [ 18.8 ms ] threadI think more information is needed. If you're storing files PAR2 can help. If you're hashing passwords, bcrypt and scrypt should be investigated.
Securing the database against bitrot, etc. would be another question entirely.
https://en.m.wikipedia.org/wiki/ZFS
ZFS is a file system that is available on FreeBSD, and Linux, and more!