Skip to main content

random_index

Function random_index 

Source
fn random_index(n: usize) -> usize
Expand description

A random index in [0, n), or 0 when n is 0 or entropy is unavailable. The lone impurity in the routine engine; kept tiny so the pure selection core stays fully testable. Uniform enough for picking a routine (the modulo bias across a handful of routines is negligible).