merkle-root
Library for calculating the Merkle root of either a file, or walked directory.
Supports both xxHash (non-cryptographic) and SHA2-256.
- Files are split into 8kb blocks, then recursively hashed.
- Walked "directories" are hashes into
narbitrary levels. Individual files can be "tested" for inclusion inO(n * log n)time.
use MerkleTree;
let data_to_hash = ;
let tree = from_reader.unwrap;
assert_eq!;
Meta
This library is forked from Fuchsia.
Changes:
- Support for non-cryptographic hashes (
xxhash-rust). - Create a
MerkleTreefrom a walked directory.
License
This work is originally under the BSD License.
Any new contributions are under the MIT License.