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 rhettinger
Recipients Arfrever, alex, dstufft, ezio.melotti, mark.dickinson, neologix, pitrou, rhettinger, tim.peters
Date 2014-05-11.19:15:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1399835711.85.0.52823851247.issue21470@psf.upfronthosting.co.za>
In-reply-to
Content
>  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.
History
Date User Action Args
2014-05-11 19:15:11rhettingersetrecipients: + rhettinger, tim.peters, mark.dickinson, pitrou, ezio.melotti, Arfrever, alex, neologix, dstufft
2014-05-11 19:15:11rhettingersetmessageid: <1399835711.85.0.52823851247.issue21470@psf.upfronthosting.co.za>
2014-05-11 19:15:11rhettingerlinkissue21470 messages
2014-05-11 19:15:10rhettingercreate