Skip to main content

draw_seed

Function draw_seed 

Source
pub fn draw_seed(base: u64, index: u64) -> u64
Expand description

splitmix64 over (base, index) — the pool draw stream’s index function.

splitmix64 rather than “seed the RNG with base ^ index” because adjacent seeds must produce unrelated streams: StdRng is ChaCha12, which would tolerate the naive version, but the whole point of this function is that nothing downstream has to know that. splitmix64 decorrelates by construction and is the mixer SeedableRng::seed_from_u64 itself uses.