larger seeds for Mersenne

J

jt

I'm trying to learn how to use a seed for the random module that is
larger than the integer produced by python's built-in hash(x) function.
From the documentation, it says:

"If x is not None or an int or long, hash(x) is used instead. If x is an
int or long, x is used directly."

So if I through something other than an int or long, it gets hashed down
to an int. Which is what, 10 bytes or so? So it seems like it would be
preferable to use something like md5 or sha to hash because then I'd get
16 or 20 bytes for the seed. But the problem is that md5 and sha don't
hash to a long. They include lots of other printable and nonprintable
characters.

Does anyone know of a hashing algorithm that hashes to a long that's
16-20+ bytes long? Thanks for any help.

jt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top