RANLUX24 is the C++ standard library implementation of Martin Lüscher’s luxury-level random number generator. It uses a 24-bit subtract-with-borrow base engine with a discard block adaptor that discards 200 out of every 223 generated numbers for improved statistical quality.
| Property | Value |
|---|---|
| Category | Random Number Generators |
| Sub-category | Pseudo-Random Number Generator |
| Security status | 🎓 Educational Only |
| Complexity | Intermediate |
| Inventor | Martin Lüscher |
| Year | 1994 |
| Origin | 🇨🇭 Switzerland |
| Source | algorithms/random/ranlux24.js |
| Parameter | Supported values |
|---|---|
| Seed sizes | 4 bytes (32 bits) |
| Flag | Value |
|---|---|
IsDeterministic |
Yes |
IsCryptographicallySecure |
No |
Status: 🎓 Educational Only
No vulnerabilities are recorded for this implementation.
4 vectors ship with this algorithm and run in the test suite. Byte values are hexadecimal.
Vector 1 — C++ std::ranlux24 with seed 1, first 5 outputs
| Field | Value |
|---|---|
seed |
01000000 |
outputSize |
15 |
input |
null |
expected |
0c5f871f153967fc4f6cb618599fb0 |
Vector 2 — C++ std::ranlux24 with seed 314159265 (FORTRAN default), first 5 outputs
| Field | Value |
|---|---|
seed |
a1b0b912 |
outputSize |
15 |
input |
null |
expected |
117f61a40213310c8a02a7552fcfea |
Vector 3 — C++ std::ranlux24 with seed 12345, first 5 outputs
| Field | Value |
|---|---|
seed |
39300000 |
outputSize |
15 |
input |
null |
expected |
6bfbfaa56bafc20b1c49a1b4d08033 |
Vector 4 — C++ std::ranlux24 with seed 42, first 5 outputs
| Field | Value |
|---|---|
seed |
2a000000 |
outputSize |
15 |
input |
null |
expected |
9f9b35687a5d41631f63ed0df023fa |