| Crates.io | fast_rands |
| lib.rs | fast_rands |
| version | 0.15.4 |
| created_at | 2025-11-13 00:30:54.52452+00 |
| updated_at | 2025-11-13 00:30:54.52452+00 |
| description | Non-cryptographically, but quite fast, RNG implementations |
| homepage | |
| repository | https://github.com/AFLplusplus/LibAFL/ |
| max_upload_size | |
| id | 1930193 |
| size | 56,531 |
Fast_Rands: Get (non-cryptographically secure!) Random Numbers Faster.The faster_rands crate is a collection of a range of fast RNGs, such as RomuRand and others.
It can be used together with LibAFL or any place that needs random numbers, as long as you don't rely on the randomness for security.
use fast_rands::{Rand, StdRand};
use core::num::NonZeroUsize;
// Create a new random number generator with a random seed
let mut rand = StdRand::new();
// Get a random u64
let n = rand.next();
// Get a random number below 100
let below_100 = rand.below(NonZeroUsize::new(100).unwrap());
// Get a random number between 50 and 100 (inclusive)
let between_50_and_100 = rand.between(50, 100);
LibAFL ProjectThe LibAFL project is part of AFLplusplus and maintained by
For bugs, feel free to open issues or contact us directly. Thank you for your support. <3
Even though we will gladly assist you in finishing up your PR, try to
cfgs.)cargo nightly fmt on your code before pushingcargo clippy --all or ./clippy.shcargo build --no-default-features to check for no_std compatibility (and possibly add #[cfg(feature = "std")]) to hide parts of your code.Some parts in this list may sound hard, but don't be afraid to open a PR if you cannot fix them by yourself. We will gladly assist.