I have a source of random bits that I would like to massage into integers of different sizes, roughly correlating with the size of popular cubes (1-4, 1-6, etc.).
The code I'm writing is PHP, so the answer in this language is perfect. However, the algorithmic general answer will also be completely fine.
I would prefer the answer to be more complex than just carving out the PHP random () function with chunks of my random data.
source
share