Crates.io | merkle-root |
lib.rs | merkle-root |
version | |
source | src |
created_at | 2024-10-12 18:25:42.704667 |
updated_at | 2024-10-12 18:25:42.704667 |
description | Library for calculating the Merkle root of either a file, or walked directory. |
homepage | |
repository | |
max_upload_size | |
id | 1406733 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
merkle-root
Library 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.