August 2003
Intermediate to advanced
1104 pages
19h 27m
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.
Pseudorandom number generators need seeding. Traditionally, the program seeds the generator itself, but PHP can handle this task. For ...