[Haskell] Fingerprints and hashing

Bryan O'Sullivan bos at serpentine.com
Fri Oct 12 10:01:37 EDT 2007

Neil Mitchell wrote:
> Hi Simon,
>> We are all familiar with the idea of an MD5 checksum, which provides a reliable "fingerprint" for a file, usually 128 bits or so.  If the file changes, the fingerprint is (almost) certain to do so too.  There are lots of techniques: CRC, shar?, MD5, etc.
> I believe the basic operations are all in the Crypto library:
> http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Crypto-3.0.3
> - see Data.Digest.SHA1 and Data.Digest.MD5 - digest is simply another
> word for fingerprint in this sense.

The Crypto library does indeed provide those operations, but the 
implementations are naive and hence extremely slow.  Fine for hashing an 
individual password, but not appropriate for ten thousand identifiers in 
a compiler.


More information about the Haskell mailing list