Skip to main content

random_range_to

Function random_range_to 

Source
pub fn random_range_to(max: u64) -> Result<u64, CryptoError>
Expand description

Generate a random integer in [0, max) using rejection sampling.

This is the renamed form of the old single-argument random_range(max). Returns CryptoError::BadInput if max == 0.