List of random number generators
are important in many kinds of technical applications, including physics, engineering or mathematical computer studies, cryptography and gambling.
This list includes many common types, regardless of quality.
Pseudorandom number generators (PRNGs)
Whenever using a pseudorandom number generator, keep in mind John von Neumann's dictum "Anyone who considers arithmetical methods of producing random digits is, of course, in a state of sin."The following algorithms are pseudorandom number generators.
Generator | Date | First proponents | References | Notes |
Middle-square method | 1946 | J. von Neumann | In its original form, it is of poor quality and of historical interest only. | |
Lehmer generator | 1951 | D. H. Lehmer | One of the very earliest and most influential designs. | |
Linear congruential generator | 1958 | W. E. Thomson; A. Rotenberg | A generalisation of the Lehmer generator and historically the most influential and studied generator. | |
Lagged Fibonacci generator | 1958 | G. J. Mitchell and D. P. Moore | ||
Linear feedback shift register | 1965 | R. C. Tausworthe | A hugely influential design. Also called Tausworthe generators. | |
Wichmann–Hill generator | 1982 | B. A. Wichmann and D. I. Hill | A combination of three small LCGs, suited to 16-bit CPUs. Widely used in many programs, e.g. it is used in Excel 2003 and later versions for the function RAND and it was the default generator in the language Python up to version 2.2. | |
Rule 30 | 1983 | S. Wolfram | Based on cellular automata. | |
Inversive congruential generator | 1986 | J. Eichenauer and J. Lehn | ||
Park-Miller generator | 1988 | S. K. Park and K. W. Miller | A specific implementation of a Lehmer generator, widely used because built-in in the C and C++ languages as the function `minstd'. | |
ACORN generator | 1989 | R. S. Wikramaratna | The Additive Congruential Random Number generator. Simple to implement, fast, but not widely known. With appropriate initialisations, passes all current empirical test suites, and is formally proven to converge. Easy to extend for arbitrary period length and improved statistical performance over higher dimensions and with higher precision. | |
MIXMAX generator | 1991 | G. K. Savvidy and N. G. Ter-Arutyunyan-Savvidy | It is a member of the class of matrix linear congruential generator, a generalisation of LCG. The rationale behind the MIXMAX family of generators relies on results from ergodic theory and classical mechanics. | |
Add-with-carry | 1991 | G. Marsaglia and A. Zaman | A modification of Lagged-Fibonacci generators. | |
Subtract-with-borrow | 1991 | G. Marsaglia and A. Zaman | A modification of Lagged-Fibonacci generators. A SWB generator is the basis for the RANLUX generator, widely used e.g. for particle physics simulations. | |
Maximally periodic reciprocals | 1992 | R. A. J. Matthews | A method with roots in number theory, although never used in practical applications. | |
KISS | 1993 | G. Marsaglia | Prototypical example of a combination generator. | |
Multiply-with-carry | 1994 | G. Marsaglia; C. Koç | ||
Complementary-multiply-with-carry | 1997 | R. Couture and P. L’Ecuyer | ||
Mersenne Twister | 1998 | M. Matsumoto and T. Nishimura | Closely related with LFSRs. In its MT19937 implementation is probably the most commonly used modern PRNG. Default generator in the Python language starting from version 2.3. | |
Xorshift | 2003 | G. Marsaglia | It is a very fast sub-type of LFSR generators. Marsaglia also suggested as an improvement the xorwow generator, in which the output of a xorshift generator is added with a Weyl sequence. The xorwow generator is the default generator is the CURAND library of the nVidia CUDA application programming interface for graphics processing units. | |
Well equidistributed long-period linear | 2006 | F. Panneton, P. L'Ecuyer and M. Matsumoto | A LFSR closely related with Mersenne Twister, aiming at remedying some of its shortcomings. | |
A small noncryptographic PRNG | 2007 | Bob Jenkins | ||
Advanced Randomization System | 2011 | J. Salmon, M. Moraes, R. Dror and D. Shaw | A simplified version of the AES block cipher, leading to very fast performance on system supporting the AES-NI. | |
Threefry | 2011 | J. Salmon, M. Moraes, R. Dror and D. Shaw | A simplified version of the Threefish block cipher, suitable for GPU implementations. | |
Philox | 2011 | J. Salmon, M. Moraes, R. Dror and D. Shaw | A simplification and modification of the block cipher Threefish with the addition of an S-box. | |
SplitMix | 2014 | G. L. Steele, D. Lea and C. H. Flood | Based upon the final mixing function of MurmurHash3. Included in Java Development Kit 8 and above. | |
Permuted Congruential Generator | 2014 | M. E. O'Neill | A modification of LCG. | |
Random Cycle Bit Generator | 2016 | R. Cookman | RCB is described as a bit pattern generator made to overcome some of the shortcomings with Mersenne Twister and short periods/bit length restriction of shift/modulo generators. | |
Middle Square Weyl Sequence PRNG | 2017 | B. Widynski | A variation on John von Neumann's original middle-square method, this generator may be the fastest PRNG that passes all the statistical tests. | |
Xoroshiro128+ | 2018 | D. Blackman, S. Vigna | A modification of Marsaglia's Xorshift generators, one of the fastest generators on modern 64-bit CPUs. Related generators include xoroshiro128**, xoshiro256+ and xoshiro256**. | |
64-bit MELG | 2018 | S. Harase, T. Kimoto | An implementation of 64-bit maximally equidistributed F2-linear generators with Mersenne prime period. | |
Squares RNG | 2020 | B. Widynski | A counter-based version of Middle Square Weyl Sequence PRNG. According to the author this appears to be one of the fastest counter-based generators. |
Cryptographic algorithms
algorithms and cryptographic hashes can be used as very high-quality pseudorandom number generators. However, generally they are considerably slower than fast, non-cryptographic random number generators.These include:
- Stream ciphers. Popular choices are Salsa20 or ChaCha, ISAAC, HC-128 and RC4.
- Block ciphers in counter mode. Common choices are AES, TwoFish, Serpent and Camellia.
- Cryptographic hash functions
- Blum–Micali algorithm
- Blum Blum Shub
- Naor–Reingold pseudorandom function
Random number generators that use external entropy
-
/dev/random
- Unix-like systems - CryptGenRandom - Microsoft Windows
- Fortuna
- Intel RDRAND instructions, available in Intel x86 CPUs since 2012. They use the AES generator built into the CPU, reseeding it periodically.
- True Random Number Generator using Corona Discharge.
- Yarrow
Random number servers
-
Well-known PRNG APIs
-
/dev/random
on Unix-like systems - in the.NET Framework
- in the Java programming language
- in the Haskell 98 specifications
- in the Objective-C and Swift languages
- in the Java programming language
- for web browsers