News for hackers. Stuff that matters.
Re:A call to PHP's mt_rand generates only odd numbers by skybrian on Friday July 24, 2015 @10:55AM (#9942387)
If the user asked for more bits of randomness, they need to generate more bits. They could have chosen a different algorithm, or perhaps called the random number generator twice and concatenated the bits. Scaling up is clearly the wrong thing to do.
Re:A call to PHP's mt_rand generates only odd numbers by mikeash on Friday July 24, 2015 @11:03AM (#9942455)
It also makes me wonder how it behaves for numbers below the limit. I would wager that there's substantial bias in the results if you ask for a max of, say, 2^31 + 2^30.