Mulberry32 is an extremely simple and fast 32-bit PRNG with single 32-bit state, designed by Tommy Ettinger. It uses a Weyl sequence combined with MurmurHash3-style mixing to produce high-quality output despite minimal state. Very fast but not equidistributed.
| Property | Value |
|---|---|
| Category | Random Number Generators |
| Sub-category | Deterministic PRNG |
| Security status | π Educational Only |
| Complexity | Beginner |
| Inventor | Tommy Ettinger |
| Year | 2017 |
| Origin | πΊπΈ United States |
| Source | algorithms/random/mulberry32.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 reference implementation
| Field | Value |
|---|---|
seed |
00000000 |
outputSize |
20 |
input |
null |
expected |
4434b46200159c3739285b08256d810477a2cbd4 |
Vector 2 β Seed 1: First 5 outputs (20 bytes) - single-bit seed difference
| Field | Value |
|---|---|
seed |
00000001 |
outputSize |
20 |
input |
null |
expected |
a087eaf300b349c98706c4ebfb2627fdf7e79d2b |
Vector 3 β Seed 42: First 8 outputs (32 bytes) - commonly used test seed
| Field | Value |
|---|---|
seed |
0000002a |
outputSize |
32 |
input |
null |
expected |
99e1ef7c72c32b8ada3b32c0ab73b0ad2cc09a8a86cec4d345f245149fef4401 |
Vector 4 β Seed 12345: First 5 outputs (20 bytes) - larger seed value
| Field | Value |
|---|---|
seed |
00003039 |
outputSize |
20 |
input |
null |
expected |
facf78c54e8751007bf4e2f2d16426508269e5ca |
Vector 5 β Seed 0xFFFFFFFF (max 32-bit): First 5 outputs (20 bytes) - edge case
| Field | Value |
|---|---|
seed |
ffffffff |
outputSize |
20 |
input |
null |
expected |
e57bf3d33081a5a4b7350390f1ade904d8616a2f |