Skip to content

alexander-irbis/mt-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Merkle Tree

Unstable

A prototype implementation. Use at your own risk.

Example

extern crate mt;

use mt::data_storage::MemoryDataStorage;
use mt::tree_storage::MemoryTreeStorage;
use mt::merkle_tree::MerkleTree;
use mt::fun::Sha256;
use mt::fun::DoubleHash;

// ....

let mut mt: MerkleTree<MemoryDataStorage<&[u8]>, MemoryTreeStorage<DoubleHash<Sha256>>>;
mt = MerkleTree::default();

// ....

mt.push(&b"123")?;
mt.push(&b"456")?;
mt.push(&b"7890")?;

// ....

mt.check_data()?;
mt.check_tree()?;

// ....

mt.get_root()? == other_root

License

Licensed under either of

Contribution

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.

About

No description, website, or topics provided.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages