Splitmix64
Counter-based 64-bit generator, widely used to seed other generators
Source found and wired, correctness not fully proven. Root API only. Reach it with NextSSL(root=True) in Python or the nextssl_root_* functions in C.
About Splitmix64
Splitmix64 is a non-cryptographic pseudorandom generator. It uses a 1–268,435,456-byte output and an 8-byte seed. Its registry entry cites SplitMix64 (Steele, Lea, Flood 2014; Vigna), NOT cryptographically secure. NextSSL lists it in the unverified tier and exposes it through the root API only (NextSSL(root=True) in Python, nextssl_root_* in C).
Overview
SplitMix64 is a simple 64-bit pseudorandom number generator that adds a constant to a counter and passes the result through a strong mixing function. It is mainly used to expand a single seed into the larger state of generators such as xoshiro, and it underlies Java's SplittableRandom.
The state is a single 64-bit counter that advances by the odd constant 0x9E3779B97F4A7C15, derived from the golden ratio, at each step. Output is produced by a finaliser of xor-shifts and multiplications, similar to the finaliser of MurmurHash3, which makes nearby counter values produce unrelated outputs. Because the update is a simple counter, the period is exactly 2^64 and every state is visited.
The design was introduced with the splittable random generator in Java 8 by Steele, Lea and Flood, and later popularised by Vigna as the recommended seeder for xoshiro and xoroshiro. One variant is present: splitmix64. Its output passes standard statistical test suites, but seeds that differ by a multiple of the increment produce shifted copies of the same stream, so it is recommended mainly for seeding other generators rather than as a primary generator.
History
2014–2014SplitMix64 published by Guy L. Steele Jr., Doug Lea, Christine H. Flood
How it works
- Add the golden-ratio constant to the 64-bit state.
- Xor-shift the result right by 30 and multiply by a constant.
- Xor-shift right by 27 and multiply by a second constant.
- Xor-shift right by 31 and return the value.
Security notes
Not cryptographically secure: the mixing function is invertible, so a single output reveals the counter and therefore every past and future output.
Typical uses
Sizes
| Field | Bytes | Meaning |
|---|---|---|
| out | 1 – 268,435,456 | Output |
| seed | 8 | Seed |
Use it
from nextssl_demo import NextSSL
root = NextSSL(root=True) # tier 'unverified' is reachable from the root API only
buf = root.call("rng_fill", "splitmix64", "seed=42", 32)[0] # not for keys
nextssl_root_rng_fill("splitmix64", "seed=42", 32, out);
// prng is a root-only kind: use the C ABI (nextssl_root_*)
// or the Prng trait in nextssl-core/src/traits.rs
Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.
More non-cryptographic prngs
All 26Frequently asked questions
What is Splitmix64?
Splitmix64 is a PRNG in the SplitMix64 family. SplitMix64 is a simple 64-bit pseudorandom number generator that adds a constant to a counter and passes the result through a strong mixing function.
What are the Splitmix64 sizes?
In NextSSL, Splitmix64 uses: output 1 to 268,435,456 bytes.
Who designed Splitmix64 and when?
Splitmix64 belongs to the SplitMix64 family, first published in 2014 by Guy L. Steele Jr., Doug Lea, Christine H. Flood. Its origin: Steele, Lea and Flood, Fast Splittable Pseudorandom Number Generators (OOPSLA 2014).
Which standards define Splitmix64?
Splitmix64 is referenced by SplitMix64 (Steele, Lea, Flood 2014; Vigna), NOT cryptographically secure.
Is Splitmix64 safe to use?
Splitmix64 is in the unverified tier. Source found and wired, correctness not fully proven. Root API only. It is only reachable through the root API (NextSSL(root=True) in Python, nextssl_root_* in C).