# Generate Random numbers using standard library
[](https://unlicense.org)
[](https://crates.io/crates/stdrandom)
[](https://blog.rust-lang.org/2021/10/21/Rust-1.56.0/)
[](https://docs.rs/stdrandom)
[](https://crates.io/crates/stdrandom/versions)
## Overview
This Rust crate provides various **random number generation utilities**, including:
- Random **u32 and u64** generation.
- **Floating-point randomness** (`f32` and `f64`) in `[0,1)`.
- Random **byte filling** for buffers.
- Random number from **Range**
- **Fast** but lower-entropy alternatives using thread local `RandomState`.
## Features
- Minimal supported Rust version **1.56**
- No external dependencies beyond standard Rust library
- **Thread-based randomness**: Uses separate threads for improved entropy (`random_u64()`).
- **Secure and fast implementations** for generating random numbers.
- **Uniform distribution** ensured for floating-point values.
## Functions returning random numbers
### `random_u64(), random_u32()`
Generates a **high entropy random** number in a separate thread.
These numbers have uniform distribution and pass chi square test.
### `fast_u64(), fast_u32()`
Generates a **lower entropy random** number from current thread.
### `random_f64(), random_f32()`
Generates a **high entropy random** floating point number in a separate thread
from in \[0, 1\) range. These numbers have uniform distribution
and pass chi square test.
### `fast_f32(), fast_f64()`
Generates a **lower entropy random** floating point number in \[0, 1\).
## Helper Functions
### `fill_bytes(), fill_numbers()`
Fills slice with random numbers with provided generator.
### `gen_range()`
Generate random number from specified range.
## No copyright
This code is released under a "No Copyright" license.
You may use, modify, distribute, and contribute to this code without restriction.
To the extent possible under law, the author(s) of this work waive all copyright and related rights.
Licensed under CC0-1.0 OR Unlicense.