August 2000
Intermediate to advanced
800 pages
13h 15m
English
The following functions help you generate pseudorandom numbers. There are wrappers for the randomizing functions offered by your operating system, and there are functions based on the Mersenne Twister algorithm. The Mersenne Twister functions are faster and return numbers with a much better distribution suitable for cryptographic applications. The algorithm was developed by Makoto Matsumoto and Takuji Nishimura. You can read more about it on their Web page http://www.math.keio.ac.jp/~matumoto/emt. html. Pedro Melo refactored an implementation by Shawn Cokus in order to add support to PHP.
The getrandmax function returns the maximum random number that may be returned by the rand function.
<? print(getrandmax()); ...
Read now
Unlock full access