On 18 January 2017 at 16:06, Lauri Kenttä <lauri.ken...@gmail.com> wrote:
>
> If it's not acceptable to randomize the whole state, I'd recommend using
> php_random_int_silent() to generate a single seed. This would be easy to
> implement by simply changing GENERATE_SEED() into a function which first
> tries php_random_int_silent() but has the current method as a fallback. This
> would fix other use cases of GENERATE_SEED() as well.

You don't need to use the random_int functions, 4 bytes from
php_random_bytes_silent cast into a uint32_t will give you an unbiased
seed. (powers of 2 are unbiased)

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to