Expand description
§Frand
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 available on crates.io and can be
used by adding frand
to your dependencies in your project’s Cargo.toml
.
[dependencies]
frand = "0.10"
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
new
andrehash
functions. - impl_rng_core -
(default) Enables the implementation of the
rand::RngCore
andrand::SeedableRng
traits for theRand
struct. This feature is required to use FRand with therand
and 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§
- Ultra mega overcomplicated macro to parse initialization fields of benches
Structs§
Traits§
- A trait for types that can be generated randomly using FRand.
- Shuffle any array-like type
Functions§
- Retrieve the lazily-initialized thread-local random number generator.