Background
What is your motivation?
Same use case as ThreadRng serves today, but something that is faster than ThreadRng while sacrificing crystallographic security.
What type of application is this? (E.g. cryptography, game, numerical simulation)
Simple stuff like a randomized log sampler. Using rand::small_random() is much easier than
thread_local! {
static RNG: RefCell<SmallRng> = RefCell::new(SmallRng::from_rng(&mut rand::rng()));
}
fn should_emit() -> {
RNG.with_borrow_mut(|rng| rng.random_ratio(1, 1000)
}
Feature request
Create a type called SmallThreadRng that internally uses same rng as SmallRng.
Background
What is your motivation?
Same use case as ThreadRng serves today, but something that is faster than ThreadRng while sacrificing crystallographic security.
What type of application is this? (E.g. cryptography, game, numerical simulation)
Simple stuff like a randomized log sampler. Using
rand::small_random()is much easier thanFeature request
Create a type called
SmallThreadRngthat internally uses same rng asSmallRng.