This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients loewis, mark.dickinson, michael.foord, pitrou, rhettinger, terrence
Date 2010-02-09.11:43:49
SpamBayes Score 0.0036289436
Marked as misclassified No
Message-id <1265715830.92.0.470878100189.issue7889@psf.upfronthosting.co.za>
In-reply-to
Content
Well, ideally we should drop the automatic hash() and only accept:
1) ints/longs
2) buffer-like objects

(and tell people to hash() explicitly if they want to)

If that's too disruptive, we should document it.
And, for 3.x, provide the following recipe to hash from a bytes object without losing entropy, and keeping the same results under 32-bit and 64-bit builds:

>>> import random
>>> random.seed(int.from_bytes(b'foo', 'little'))
>>> random.random()
0.08384169414918807
History
Date User Action Args
2010-02-09 11:43:51pitrousetrecipients: + pitrou, loewis, rhettinger, mark.dickinson, michael.foord, terrence
2010-02-09 11:43:50pitrousetmessageid: <1265715830.92.0.470878100189.issue7889@psf.upfronthosting.co.za>
2010-02-09 11:43:49pitroulinkissue7889 messages
2010-02-09 11:43:49pitroucreate