mistero mistero - 1 year ago 175
Python Question

Random hash in Python

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

sth sth
Answer Source

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...

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download