[][src]Function xaynet::crypto::generate_integer

pub fn generate_integer(prng: &mut ChaCha20Rng, max_int: &BigUint) -> BigUint

Generates a secure pseudo-random integer.

Draws from a uniform distribution over the integers between zero (included) and max_int (excluded). Employs the ChaCha20 stream cipher as a PRNG.