[issue27272] random.Random should not read 2500 bytes from urandom

Martin Panter report at bugs.python.org
Wed Jun 8 22:49:03 EDT 2016


Martin Panter added the comment:

If the seed is to be based on time.time(), why not use something based on hash(time.time()) to avoid the 1/256 s resolution?

If there is a practical way to get pseudo-random data from the platform, it would be better to use that, rather than cooking up our own entropy from time.time(), PID, etc. But I guess that depends on the future of os.urandom() and friends.

In the meantime, limiting to os.urandom(256) seems reasonable, though I’m not a random number or cryptography expert.

----------
nosy: +martin.panter

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27272>
_______________________________________


More information about the Python-bugs-list mailing list