jobs 0 Junior Poster in Training

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?

hash = md5.new()
hash.update("some_url_")
value = hash.digest()
value_in_int = long(value, 16) #would this be unique as long as hashed string is unique(i.e < 2^64)

Do I need to also convert the value to base64.encodestring(value)? What is the purpose of base64.encodestring?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.