A simple, fast, and ergonomic generic binary [Merkle Tree] for [Rust Crypto] hash functions.
Here is how to create MerkleTree
and the Markle Root
for the ordered array of cryptographic hashes:
```
use sha3::Sha3256;
use hexliteral::hex;
use merkle_lite::MerkleTree;
// 13 identical hashes just for the demonstration purpose.
let hashes = [[0xab_u8; 32]; 13];
let tree: MerkleTree
assert_eq!( tree.root(), hex!("34fac4b8781d0b811746ec45623606f43df1a8b9009f89c5564e68025a6fd604"), ); ```
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.