SplitMix64
Counter-based 64-bit generator, widely used to seed other generators
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
Variants in NextSSL
1| Algorithm | Tier | Sizes (bytes) | Standards | API |
|---|---|---|---|---|
| Splitmix64 splitmix64 |
unverified | out 1–268435456 · seed 8 | SplitMix64 (Steele, Lea, Flood 2014; Vigna), NOT crypto… | root |
Frequently asked questions
Which SplitMix64 variants does NextSSL include?
NextSSL registers 1 SplitMix64 variant: splitmix64.