By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,660 Members | 1,105 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,660 IT Pros & Developers. It's quick & easy.

larger seeds for Mersenne

P: n/a
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

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


Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.