Crates.io | randlib |
lib.rs | randlib |
version | 0.2.0 |
source | src |
created_at | 2022-05-20 16:47:35.673197 |
updated_at | 2022-08-16 12:55:15.048448 |
description | Dependency-less random value generator using pointer addresses and time |
homepage | https://github.com/Ernest1338/randlib |
repository | https://github.com/Ernest1338/randlib |
max_upload_size | |
id | 590368 |
size | 14,089 |
Dependency-less random value generator using pointer addresses and time.
The generator is using the LCG algorithm seed by a pointer address multiplied by UNIX_EPOCH.
Basic usage (checkout the examples/usage.rs file for more examples)
use randlib::Rand;
fn main() {
let mut rng = Rand::new();
println!("random usize: {}", rng.rand());
println!("random u8: {}", rng.rand_u8());
println!("random i8: {}", rng.rand_i8());
println!("random u16: {}", rng.rand_u16());
println!("random i16: {}", rng.rand_i16());
println!("random u32: {}", rng.rand_u32());
println!("random i32: {}", rng.rand_i32());
println!("random u64: {}", rng.rand_u64());
println!("random i64: {}", rng.rand_i64());
println!("random u128: {}", rng.rand_u128());
println!("random i128: {}", rng.rand_i128());
println!("random usize: {}", rng.rand_usize());
println!("random bool: {:?}", rng.rand_bool());
}
This project is distributed under MIT license.