I\'m looking for a way to generate a big random number with PHP, something like:
mt_rand($lower, $upper);
The closer I\'ve
Generating 'n' random chars is not really an option, as random('9999999999') could still, theoretically, return 1...
Here's a quite simple function:
function bcrand($max) {
return bcmul($max, (string)mt_rand() / mt_getrandmax() );
}
Note that it will NOT return N bits of randomness, just adjust scale