MD5 hash for url and utf unicode converting to ascii

Daniel Pitts newsgroup.spamfilter at virtualinfinity.net
Mon Jun 23 21:14:41 EDT 2008


joe shoemaker wrote:
> I would like to convert url into md5 hash. My question is that md5
> hash will create collision at 2^64. If you do long(value,16), where
> value is the md5 hash string, would value returned from long(value,
> 16) be unique as long as md5 hashed string is unique? when you move
> md5 hashed string to long, where will the collision occur, at anything
MD5's are not meant to be unique keys. They are designed to make it 
difficult to alter the original value and maintain the same hash. This 
prevents both errors and malevolent data tampering.
Also note, I believe MD5 are typically 128 bits long, not 64, but the 
calculation for collision is more complicated than that.

-- 
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>



More information about the Python-list mailing list