Expand description
FRand is a blazingly fast, small, and simple pseudo-random number generator (PRNG) written in Rust. The advantage of using FRand is that it can produce more random numbers per second than other libraries. It also produces high-quality random numbers using a fast non-cryptographic hashing algorithm.
§Usage
This crate is on crates.io and can be
used by adding frand to your dependencies in your project’s Cargo.toml.
[dependencies]
frand = "0.8"§Example
FRand is really simple to use. Here is a simple example of how to use FRand to generate a random float:
use frand::Rand;
let mut rng = Rand::new();
println!("{}", rng.gen::<f32>());§Crate features
- std -
(default) Enables the use of the standard library. This feature is
required for the
newandrehashfunctions. - impl_rng_core -
(default) Enables the implementation of the
rand::RngCoreandrand::SeedableRngtraits for theRandstruct. This feature is required to use FRand with therandand things likerand::distributions. - glam - (default) Uses glam to enable the generation of random values for glam::Vec2, glam::Vec3, glam::Vec3A, and glam::Vec4.
Macros§
- setup_
benches - setup_
single_ bench - Ultra mega overcomplicated macro to parse initialization fields of benches
Structs§
Traits§
- Random
- A trait for types that can be generated randomly using FRand.
- Random
Range - Shufflable
- Shuffle any array-like type
Functions§
- thread_
rand - Retrieve the lazily-initialized thread-local random number generator.