#hashing #x11 #hash #bindings #sha-3 #algorithm #keccak

rs-x11-hash

Rust bindings for x11 hashing algorithm

5 releases

0.1.8 Jul 5, 2023
0.1.7 Jul 4, 2023
0.1.6 Jun 22, 2023
0.1.4 Apr 11, 2023
0.1.2 Dec 19, 2022

#2511 in Magic Beans

Download history 598/week @ 2024-01-02 471/week @ 2024-01-09 612/week @ 2024-01-16 931/week @ 2024-01-23 806/week @ 2024-01-30 1006/week @ 2024-02-06 906/week @ 2024-02-13 729/week @ 2024-02-20 300/week @ 2024-02-27 1725/week @ 2024-03-05 1089/week @ 2024-03-12 648/week @ 2024-03-19 1044/week @ 2024-03-26 873/week @ 2024-04-02 720/week @ 2024-04-09 449/week @ 2024-04-16

3,135 downloads per month

MIT license

115KB
127 lines

rs-x11-hash

Rust bindings for x11 hash

Performs the x11 hashing algorithm used in the Dash cryptocurrency in JavaScript.

x11 hashing algorithm sequentially uses:

BLAKEBLUE MIDNIGHT WISH (BMW)
• Groestl
• JH
• Keccak (An algorithm whose variant gave rise to SHA-3)
• Skein
• Luffa
• CubeHash
• SHavite-3SIMDECHO

C-sources taken from DashSync

Usage

Install the library as a Cargo crate.

$ cargo install rs-x11-hash

or use as a dependency in Cargo.toml

[dependencies]
rs-x11-hash = "0.1.5"

Reference the library

use hex::{FromHex, ToHex};
let x11 = "020000002cc0081be5039a54b686d24d5d8747ee9770d9973ec1ace02e5c0500000000008d7139724b11c52995db4370284c998b9114154b120ad3486f1a360a1d4253d310d40e55b8f70a1be8e32300";
let x11_vec = Vec::from_hex(x11).unwrap();
let md = rs_x11_hash::get_x11_hash(x11_vec);
println!("input: {}", x11);
println!("output: {:?}", md.encode_hex::<String>());
assert_eq!(md.to_vec(), Vec::from_hex("f29c0f286fd8071669286c6987eb941181134ff5f3978bf89f34070000000000").unwrap())

Dependencies

~0–2MB
~40K SLoC