List of random number generators
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 or applicability to a given use case.
Pseudorandom number generators (PRNGs)
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 earliest and most influential designs. | |
| Linear congruential generator | 1958 | W. E. Thomson; A. Rotenberg | A generalisation of the Lehmer generator. 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 at least Excel 2003 and 2007 for the Excel 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 | ||
| Blum Blum Shub | 1986 | M. Blum, L. Blum and M. Shub | Blum-Blum-Shub is a PRNG algorithm that is considered cryptographically secure. It is based on prime numbers. | |
| Park-Miller generator | 1988 | S. K. Park and K. W. Miller | A specific implementation of a Lehmer generator, widely used because it is included in C++ as the function minstd_rand0 from C++11 onwards. | |
| 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 generators, a generalisation of LCGs. The conceptual framework 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. 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. Its MT19937 implementation is probably the most commonly used modern PRNG. Default generator in R and the Python language starting from version 2.3. | |
| Xorshift | 2003 | G. Marsaglia | A sub-type of LFSR generators designed to be efficiently implemented in software. 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 in 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 | ||
| Small Fast Chaotic PRNG | 2010 | Chris Doty-Humphrey | ||
| Advanced Randomization System (ARS) | 2011 | J. Salmon, M. Moraes, R. Dror and D. Shaw | A simplified version of the AES block cipher, leading to very fast performance on systems 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. | |
| WELLDOC | 2013 | L. Balkova, M. Bucci, A. de Luca, J. Hladky, S. Puzynina | A set of periodic pseudorandom number generators based on infinite words. | |
| 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 of the Mersenne Twister and the short periods of shift/modulo generators. | |
| Middle-Square Weyl Sequence RNG | 2017 | B. Widynski | A variation on John von Neumann's original middle-square method. | |
| xorshiftr+ | 2018 | U. C. Çabuk, Ö. Aydın, and G. Dalkılıç | A modification of xorshift+. Significantly faster than its predecessor and passes all tests in the BigCrush suite. | |
| 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**. | |
| LXM | 2021 | G. L. Steele, S. Vigna | Composite generators combining two pseudorandom sub-generators and a mixing function. Several of these generator are implemented as part of Java 17. | |
| 64-bit MELG | 2018 | S. Harase, T. Kimoto | An implementation of 64-bit maximally equidistributed F2-linear generators with a Mersenne prime period. | |
| Squares RNG | 2020 | B. Widynski | A counter-based version of Middle-Square Weyl Sequence RNG. Similar to Philox in design but significantly faster. | |
| Collatz-Weyl Generators | 2023 | Tomasz R. Działa | A class of chaotic counter-based generators applying a broad class of non-invertible generalized Collatz mappings and Weyl sequences, enabling the generation of multiple independent streams. Leveraging 128-bit arithmetic allows for a highly efficient implementation, especially on modern 64-bit architectures. |
Cryptographic algorithms
Cipher 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
Random number generators that use external entropy
These approaches combine a pseudo-random number generator with an external source of randomness./dev/random – Unix-like systems- CryptGenRandom – Microsoft Windows
- Fortuna
- RDRAND instructions, available in Intel x86 CPUs since 2012. They use the AES generator built into the CPU, reseeding it periodically.
- Yarrow
- RANDOM.org