On 2017-01-17 16:18, Lauri Kenttä wrote:
On 2017-01-17 02:34, Yasuo Ohgaki wrote:
Set state somewhere between MT rand's 2^19937−1 cycle.
This is exactly what my patch does.
Or, to be honest, my patch provides 2^19936 possible states,
which should be more than enough.
To get all 2^19937−1, you would need to get one more bit of
entropy (2^19936 to 2^19937) and then check that the state is
not all zeros (which is the −1 in 2^19937−1). That's certainly
not worth the trouble, so I just set that one "extra" bit to 1.
(MT doesn't work if the state is all zeros.)
--
Lauri Kenttä
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php