Trait merkle_tree_stream::HashMethods
[−]
[src]
pub trait HashMethods<N> { fn leaf(&self, leaf: &PartialNode, roots: &[Rc<N>]) -> Vec<u8>; fn parent(&self, a: &N, b: &N) -> Vec<u8>; fn node(&self, partial_node: &PartialNode, hash: Vec<u8>) -> N; }
Functions that need to be implemented for MerkleTreeStream
.
Required Methods
fn leaf(&self, leaf: &PartialNode, roots: &[Rc<N>]) -> Vec<u8>
Pass data through a hash function.
fn parent(&self, a: &N, b: &N) -> Vec<u8>
Pass hashes through a hash function.
fn node(&self, partial_node: &PartialNode, hash: Vec<u8>) -> N
Combine a PartialNode
and a Hash
to a Node
type.