Function hotshot::traits::election::helpers::make_seed

source ·
fn make_seed(seed: u64, round: u64) -> u64
Expand description

Create a single u64 seed by merging two u64s. Done this way to allow easy seeding of the number generator from both a stable SOUND as well as a moving value ROUND (typically, epoch). Shift left by 8 to avoid scenarios where someone manually stepping seeds would pass over the same space of random numbers across sequential rounds. Doesn’t have to be 8, but has to be large enough that it is unlikely that a given test run will collide; using 8 means that 256 rounds (epochs) would have to happen inside of a test before the test starts repeating values from SEED+1.