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]

[src]

Constructs a new instance of the hash extractor.

impl<D, Nh> DigestHasher<D, Nh> where
    D: FixedOutput,
    Nh: NodeHasher<HashOutput = GenericArray<u8, D::OutputSize>>, 
[src]

[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]

[src]

Returns the "default value" for a type. Read more

impl<D, Nh> Clone for DigestHasher<D, Nh> where
    D: FixedOutput,
    Nh: NodeHasher<HashOutput = GenericArray<u8, D::OutputSize>>,
    Nh: Clone
[src]

[src]

Returns a copy of the value. Read more

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]

[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]

[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]

The output of the hash function.

[src]

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