Hash Code and Checksum – what’s the difference?

I would say that a checksum is necessarily a hashcode. However, not all hashcodes make good checksums.

A checksum has a special purpose — it verifies or checks the integrity of data (some can go beyond that by allowing for error-correction). “Good” checksums are easy to compute, and can detect many types of data corruptions (e.g. one, two, three erroneous bits).

A hashcode simply describes a mathematical function that maps data to some value. When used as a means of indexing in data structures (e.g. a hash table), a low collision probability is desirable.

Leave a Comment