https://github.com/chfoo/mx3-rs
Rust implementation of the mx3 algorithm
https://github.com/chfoo/mx3-rs
Last synced: about 2 months ago
JSON representation
Rust implementation of the mx3 algorithm
- Host: GitHub
- URL: https://github.com/chfoo/mx3-rs
- Owner: chfoo
- License: mit
- Created: 2021-04-30T20:17:41.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2022-06-21T18:22:00.000Z (over 3 years ago)
- Last Synced: 2025-02-28T09:41:19.862Z (12 months ago)
- Language: Rust
- Size: 20.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# mx3-rs
mx3-rs is a Rust library implementing the [mx3 algorithm](https://github.com/jonmaiga/mx3/) 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.
[](https://crates.io/crates/mx3) [](https://docs.rs/mx3)
## Quick start
### Mixing bits
```rust
let mixed_bits = mx3::v3::mix(123456789);
println!("{:x}", mixed_bits);
```
### Random number generation
```rust
use rand::prelude::*;
let mut rng = mx3::v3::Mx3Rng::new(123456789);
let random_number = rng.gen::();
println!("{}", random_number);
```
### Hashing
```rust
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.