Message99110
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 |
|
Date |
User |
Action |
Args |
2010-02-09 11:43:51 | pitrou | set | recipients:
+ pitrou, loewis, rhettinger, mark.dickinson, michael.foord, terrence |
2010-02-09 11:43:50 | pitrou | set | messageid: <1265715830.92.0.470878100189.issue7889@psf.upfronthosting.co.za> |
2010-02-09 11:43:49 | pitrou | link | issue7889 messages |
2010-02-09 11:43:49 | pitrou | create | |
|