Crate mx3

source · []
Expand description

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

The crate is not intended for cryptographically secure purposes.

The crate implements versions 1, 2, and 3.


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);


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


Version 1 implementation.

Version 2 implementation.

Version 3 implementation.


Hasher for computing a hash digest of a stream of bytes.