turborand 0.3.0

A simple and fast random number generator
docs.rs failed to build turborand-0.3.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: turborand-0.10.1

turborand

CI License Cargo Documentation

A fast random number generator.

turborand's internal implementation uses Wyrand, a simple and fast generator but not cryptographically secure.

Examples

use turborand::*;

let rand = rng!();

if rand.bool() {
    println!("Success! :D");
} else {
    println!("Failure... :(");
}

Sample a value from a list:

use turborand::*;

let rand = rng!();

let values = [1, 2, 3, 4, 5];

let value = rand.sample(&values);

Generate a vector with random values:

use turborand::*;
use std::iter::repeat_with;

let rand = rng!();

let values: Vec<_> = repeat_with(|| rand.f32()).take(10).collect();

License

Licensed under either of

at your option.