Struct mrkl::digest::DigestHasher
[−]
[src]
pub struct DigestHasher<D, Nh = DefaultNodeHasher<D>> where
D: FixedOutput,
Nh: NodeHasher<HashOutput = GenericArray<u8, D::OutputSize>>, { /* fields omitted */ }
Provides a cryptographic hash function implementation for hashing Merkle trees with byte order sensitive input.
The hash function implementation is defined by the first type parameter.
As the byte order may be important for generic input values, that type
has to implement digest_hash::EndianInput
.
The implementation of a concatenated hash over node's children is defined by the second type parameter. The default choice should be good enough unless a specific way to derive concatenated hashes is required.
Methods
impl<D, Nh> DigestHasher<D, Nh> where
D: FixedOutput,
Nh: NodeHasher<HashOutput = GenericArray<u8, D::OutputSize>>,
Nh: Default,
[src]
D: FixedOutput,
Nh: NodeHasher<HashOutput = GenericArray<u8, D::OutputSize>>,
Nh: Default,
impl<D, Nh> DigestHasher<D, Nh> where
D: FixedOutput,
Nh: NodeHasher<HashOutput = GenericArray<u8, D::OutputSize>>,
[src]
D: FixedOutput,
Nh: NodeHasher<HashOutput = GenericArray<u8, D::OutputSize>>,
fn with_node_hasher(node_hasher: Nh) -> Self
[src]
Constructs a new instance of the hash extractor taking an instance of the node hasher.
Trait Implementations
impl<D, Nh> Default for DigestHasher<D, Nh> where
D: FixedOutput,
Nh: NodeHasher<HashOutput = GenericArray<u8, D::OutputSize>>,
Nh: Default,
[src]
D: FixedOutput,
Nh: NodeHasher<HashOutput = GenericArray<u8, D::OutputSize>>,
Nh: Default,
impl<D, Nh> Clone for DigestHasher<D, Nh> where
D: FixedOutput,
Nh: NodeHasher<HashOutput = GenericArray<u8, D::OutputSize>>,
Nh: Clone,
[src]
D: FixedOutput,
Nh: NodeHasher<HashOutput = GenericArray<u8, D::OutputSize>>,
Nh: Clone,
fn clone(&self) -> Self
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<D, Nh> Debug for DigestHasher<D, Nh> where
D: EndianInput + FixedOutput,
Nh: NodeHasher<HashOutput = GenericArray<u8, D::OutputSize>>,
Nh: Debug,
[src]
D: EndianInput + FixedOutput,
Nh: NodeHasher<HashOutput = GenericArray<u8, D::OutputSize>>,
Nh: Debug,
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter.
impl<D, Nh, In: ?Sized> Hasher<In> for DigestHasher<D, Nh> where
In: Hash,
D: Default,
D: EndianInput + FixedOutput,
Nh: NodeHasher<HashOutput = GenericArray<u8, D::OutputSize>>,
[src]
In: Hash,
D: Default,
D: EndianInput + FixedOutput,
Nh: NodeHasher<HashOutput = GenericArray<u8, D::OutputSize>>,
fn hash_input(&self, input: &In) -> Self::HashOutput
[src]
Hash an element of the input data. Read more
impl<D, Nh> NodeHasher for DigestHasher<D, Nh> where
D: FixedOutput,
Nh: NodeHasher<HashOutput = GenericArray<u8, D::OutputSize>>,
[src]
D: FixedOutput,
Nh: NodeHasher<HashOutput = GenericArray<u8, D::OutputSize>>,
type HashOutput = GenericArray<u8, D::OutputSize>
The output of the hash function.
fn hash_children<'a, L>(
&'a self,
iter: Children<'a, Self::HashOutput, L>
) -> Self::HashOutput
[src]
&'a self,
iter: Children<'a, Self::HashOutput, L>
) -> Self::HashOutput
Hash a sequence of child nodes to produce the parent hash value. Read more