mx3

Crates.iomx3
lib.rsmx3
version1.0.1
sourcesrc
created_at2021-04-30 21:26:42.500948
updated_at2022-06-21 18:21:53.762349
descriptionImplementation of the mx3 algorithm providing a bit mixer, pseudo-random number generator, and hash function.
homepage
repositoryhttps://github.com/chfoo/mx3-rs
max_upload_size
id391717
size31,883
Christopher Foo (chfoo)

documentation

README

mx3-rs

mx3-rs is a Rust library implementing the mx3 algorithm which provides a bit mixer, pseudo-random number generator, and hash function. This crate implements versions 1, 2, and 3.

The crate is not intended for cryptographically secure purposes.

Crates.io docs.rs

Quick start

Mixing bits

let mixed_bits = mx3::v3::mix(123456789);
println!("{:x}", mixed_bits);

Random number generation

use rand::prelude::*;

let mut rng = mx3::v3::Mx3Rng::new(123456789);
let random_number = rng.gen::<f64>();
println!("{}", random_number);

Hashing

let hash_digest = mx3::v3::hash(b"Hello world!", 123456789);
println!("{:x}", hash_digest);

Contributing

If you have problems or bug fixes, please use the GitHub Issues and Pull Request sections.

License

Copyright (c) 2021-2022 Christopher Foo. Licensed under the MIT License.

Commit count: 8

cargo fmt