R3m/framework Function reference math.random

{math.random(Int $min, Int $max)}

Generates cryptographic random integers that are suitable for use where unbiased results are critical, such as when shuffling a deck of cards for a poker game.

The sources of randomness used for this function are as follows:

- On Windows, » CryptGenRandom() will always be used. As of PHP 7.2.0, the » CNG-API will always be used instead.
- On Linux, the » getrandom(2) syscall will be used if available.
- On other platforms, /dev/urandom will be used.
- If none of the aforementioned sources are available, then an Exception will be thrown.

Returns a cryptographically secure random integer in the range min to max, inclusive as an int .

More information:


Last modified: 2021-06-07

© 2021 universeorange.com