4 releases (2 breaking)

0.3.0 Jun 30, 2023
0.2.0 May 17, 2023
0.1.1 May 6, 2022
0.1.0 May 4, 2022

#2219 in Algorithms

Download history 15/week @ 2024-07-25 3/week @ 2024-08-01 7/week @ 2024-09-19 3/week @ 2024-09-26

52 downloads per month
Used in ordlebot

MIT license

50KB
689 lines

mersenne-twister

Mersenne Twister(MT19937) implementation in Rust. Found on crates as mersenne-twister-m

Examples

Create MT19937 instance with either default seed

let mut mt = MT19937::default();
let mut mt = MT19937::new();

or a custom seed

let mut mt = MT19937::new_with_seed(4537);

generate or peek random value with

mt.genrand()
mt.peek()

Build

Build with

cargo build

Test

Run tests with

cargo test

Dependencies