Hi everyone, I'm working on a library to backport random_bytes() and random_int() into PHP 5. The effort is located on Github if anyone is interested: https://github.com/paragonie/random_compat
My reason for this email is that I'm running into one compatibility issue that I don't think I can safely work around: If we let random_int() default to -PHP_INT_MAX and PHP_INT_MAX, then the difference between the two (used to calculate the range) will overflow into a float, which will lead to a loss of precision. My current compromise is to use -(PHP_INT_MAX/2) and PHP_INT_MAX/2, but I'm not sure if there's a better solution. Scott Arciszewski Chief Development Officer Paragon Initiative Enterprises <https://paragonie.com> -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php