| Crates.io | merkle-root |
| lib.rs | merkle-root |
| version | 1.1.0 |
| created_at | 2024-10-12 18:25:42.704667+00 |
| updated_at | 2025-02-08 20:28:14.016856+00 |
| description | Library for calculating the Merkle root of either a file, or walked directory. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1406733 |
| size | 32,936 |
merkle-rootLibrary for calculating the Merkle root of either a file, or walked directory.
Supports both xxHash (non-cryptographic) and SHA2-256.
n arbitrary levels. Individual files can be "tested" for inclusion in O(n * log n) time.use merkle_root::MerkleTree;
let data_to_hash = [0xffu8; 8192];
let tree = MerkleTree::from_reader(&data_to_hash[..]).unwrap();
assert_eq!(
tree.root(),
hex::decode("68d131bc271f9c192d4f6dcd8fe61bef90004856da19d0f2f514a7f4098b0737").unwrap()
);
This library is forked from Fuchsia.
Changes:
xxhash-rust).MerkleTree from a walked directory.This work is originally under the BSD License.
Any new contributions are under the MIT License.