rule30

Crates.iorule30
lib.rsrule30
version0.2.0
sourcesrc
created_at2023-10-20 10:50:55.020068
updated_at2023-12-13 02:15:19.340113
descriptionPseudo random number generator with cellular automaton rule 30.
homepage
repositoryhttps://github.com/kemingy/rule30
max_upload_size
id1008874
size33,754
Keming (kemingy)

documentation

https://docs.rs/rule30

README

Rule30

Rust crates.io docs.rs

Pseudo random number generator with cellular automaton rule 30.

Features

  • no_std
  • Extend CA for better performance

Usage

use rule30::prelude::*;


fn main() {
    let mut ca = ExtendedCA::seed_from_u64(42);
    println!("{}", ca.next_u64());
}

To work with rand crate:

use rule30::prelude::*;
use rand::Rng;


fn main() {
    let mut ca = ExtendedCA::seed_from_u64(42);
    println!("{}", ca.gen::<f64>());
}

For Python binding, check rule30py

Reference

Commit count: 23

cargo fmt