| Crates.io | rand_mt_64 |
| lib.rs | rand_mt_64 |
| version | 0.1.3 |
| created_at | 2025-07-06 06:29:43.660325+00 |
| updated_at | 2025-07-06 06:58:13.238171+00 |
| description | A high-resolution random number generator using Mersenne Twister 64 |
| homepage | |
| repository | https://github.com/mahib1/randMT64.git |
| max_upload_size | |
| id | 1739856 |
| size | 11,409 |
A lightweight, fast, and high-resolution pseudo-random number generator in Rust based on the Mersenne Twister 64-bit algorithm โ with support for u128 outputs and floating-point results mapped to any configurable range.
Crate name: randMT64
Module root: rand_num_gen
Author: @mahib1
SystemTimef64 outputs in any intervalstd)Add to your Cargo.toml:
[dependencies]
rand_mt_64 = "0.1.2"
Use in code:
use rand_mt_64::{rand, RandomRange};
fn main() {
let r1 = rand(RandomRange::default()).unwrap();
println!("Random float [0, 1): {}", r1);
let r2 = rand(RandomRange::new(10, 100)).unwrap();
println!("Random float [10, 100): {}", r2);
}
rand_mt_64/
โโโ src/
โ โโโ lib.rs # Public API
โ โโโ mt64.rs # Mersenne Twister 64-bit implementation
โ โโโ time.rs # SystemTime-based seeding
โ โโโ range.rs # RandomRange config and mapping
โโโ examples/
โ โโโ usage.rs # Sample usage
โโโ Cargo.toml
โโโ README.md
rand(config: &RandomRange) -> Result<f64, std::io::Error>f64 in the interval [config.start, config.end)RandomRange::new(start: u128, end: u128)RandomRange::default()[0, 1) using the MAGIC resolution constantLicensed under either of:
no_stdMersenneTwister64 directly via the crate rootrandMT64?Because
randis too big, andrand_coreis too low-level. This is the minimalist, high-precision, configurableu128solution you didnโt know you needed.
Built by @mahib1