crc32 to be used as hash

Weiguang Shi wgshi at namao.cs.ualberta.ca
Thu Nov 11 14:07:31 EST 2004


Hi there,

I'm thinking of using binascii.crc32 as a hash-function when I read in
the reference
http://www.python.org/doc/current/lib/module-binascii.html:

   crc32(	data[, crc])	
   
      Compute CRC-32, the 32-bit checksum of data, starting with an
      initial crc. This is consistent with the ZIP file checksum.
      Since the algorithm is designed for use as a checksum algorithm,
      it is not suitable for use as a general hash algorithm.

CRC32 has been shown in the (Internetworking) literature that it can
be used as a good hash function. I'm wondering what's the concern
here.

Thanks
Weiguang



More information about the Python-list mailing list