The Fletcher checksums are a good compromise (as used in the ZFS filesystem, and the modified Adler version in zlib). A ones-complement addition is very fast, but not particularly robust.
However, the main bottleneck will be disk access, not the speed of the checksum computation.
You also have to weigh up the possibility of a checksum collision; if the file is different but the checksum is the same (which is more likely with shorter checksums), what will be the consequences in your application? There are good reasons for the popularity of MD5.
Last edited by neonsignal; 10-21-2010 at 01:10 AM.
|