#hash #random #no-std

no-std mx3

Implementation of the mx3 algorithm providing a bit mixer, pseudo-random number generator, and hash function

4 releases (2 stable)

Uses new Rust 2021

1.0.1 Jun 21, 2022
1.0.0 Jun 20, 2022
0.2.0 May 1, 2021
0.1.0 Apr 30, 2021

#392 in Algorithms

Download history 6/week @ 2022-03-16 6/week @ 2022-03-23 2/week @ 2022-04-06 2/week @ 2022-04-20 6/week @ 2022-04-27 22/week @ 2022-05-04 31/week @ 2022-05-11 10/week @ 2022-05-18 11/week @ 2022-05-25 17/week @ 2022-06-01 11/week @ 2022-06-08 33/week @ 2022-06-15 36/week @ 2022-06-22 14/week @ 2022-06-29

94 downloads per month
Used in 2 crates (via webaves)

MIT license

27KB
682 lines

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.

Dependencies

~50KB