Fast non-cryptographic PRNG based on XXHash32 mixing function, designed by Yann Collet. Uses XXHash32 finalizer for high-quality bit mixing with minimal state. Excellent speed and distribution properties for simulation and testing applications.
| Property | Value |
|---|---|
| Category | Random Number Generators |
| Sub-category | Hash-Based PRNG |
| Security status | 🎓 Educational Only |
| Complexity | Intermediate |
| Inventor | Yann Collet (XXHash) |
| Year | 2012 |
| Origin | 🇫🇷 France |
| Source | algorithms/random/xxhash32.js |
| Parameter | Supported values |
|---|---|
| Seed sizes | 1 byte (8 bits) to 4 bytes (32 bits) |
| Flag | Value |
|---|---|
IsDeterministic |
Yes |
IsCryptographicallySecure |
No |
Status: 🎓 Educational Only
No vulnerabilities are recorded for this implementation.
5 vectors ship with this algorithm and run in the test suite. Byte values are hexadecimal.
Vector 1 — Seed 0: First 5 outputs (20 bytes) - verified against XXHash32 reference
| Field | Value |
|---|---|
seed |
00000000 |
outputSize |
20 |
input |
null |
expected |
0ab656ac82724c0ed3671dd6a0f55055643a0950 |
Vector 2 — Seed 1: First 5 outputs (20 bytes) - single-bit seed difference
| Field | Value |
|---|---|
seed |
00000001 |
outputSize |
20 |
input |
null |
expected |
457f061bdc17b1d66cf5b9c576cdea3599019835 |
Vector 3 — Seed 42: First 5 outputs (20 bytes) - commonly used test seed
| Field | Value |
|---|---|
seed |
0000002a |
outputSize |
20 |
input |
null |
expected |
05b53c5f98e65c749afbb51ee4975debe497495f |
Vector 4 — Seed 0xDEADBEEF: First 5 outputs (20 bytes) - edge case
| Field | Value |
|---|---|
seed |
deadbeef |
outputSize |
20 |
input |
null |
expected |
ec99cb63b2f96d4d93c66585be27dfa9682cbb3f |
Vector 5 — Seed 12345: First 5 outputs (20 bytes) - larger seed value
| Field | Value |
|---|---|
seed |
00003039 |
outputSize |
20 |
input |
null |
expected |
6357aaafbb22dcb3f7142ec87c349aa117d64c25 |