mistero mistero - 3 months ago 7
Python Question

Random hash in Python

What is the easiest way to generate a random hash (MD5) in Python?

sth sth

A md5-hash is just a 128-bit value, so if you want a random one:

import random

hash = random.getrandbits(128)

print "hash value: %032x" % hash

I don't really see the point, though. Maybe you should elaborate why you need this...