Raymond Hettinger added the comment:

>  32 bytes seeding is more than enough.

Not enough to cover *our* state space (2 ** 19937 - 1).

This tracker item boils down to balancing "fear that something bad will happen 
when you call urandom(2500)" versus "having seeding sufficient to cover the 
state space".

My judgment (based on the cited article) is the first is FUD and that the 
second is something that has gives us the full value from the Mersenne Twister.

What constitutes "enough" is a value judgment that many vary from application 
to application.  For some applications, a much weaker PRNG  would suffice, but 
we decided long ago that we wanted the full power of MT.

If you an show an actual downside (not just fear of badness), then we have 
bigger issues (i.e. needing to document that SystemRandom() and os.urandom() 
have major limitations and should be avoided).

On my system, the difference between a call to urandom(32) and urandom(2500) is 
measured in microseconds.   I believe (but am having a hard time measuring) 
that the call is even cheaper than the subsequent processing we do 
random_seed() and init_by_array().

In other words, the worry about calling urandom(2500) appears to baseless or 
immaterial.  If you have timings that show evidence to the contrary, I would 
like to see them.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21470>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to