Trait mrkl::hash::NodeHasher [] [src]

pub trait NodeHasher {
    type HashOutput;
    fn hash_children<'a, L>(
        &'a self,
        iter: Children<'a, Self::HashOutput, L>
    ) -> Self::HashOutput; }

An algorithm to compute a hash of a sequence of child nodes.

The abstraction provided by NodeHasher is agnostic to the implementation of the hash function, and allows different ways of calculating the hash of child nodes for their parent node.

Associated Types

The output of the hash function.

Required Methods

Hash a sequence of child nodes to produce the parent hash value.

This method is used to calculate hash values of the non-leaf nodes in the Merkle tree under construction. The iterator retrieves at least one node. When it's exactly one, this is likely to be the special case described in the documentation to Builder::chain_lone_child() method.

The type parameter represents arbitrary list node data and should be ignored for all purposes.

Implementors