Struct mrkl::digest::ByteDigestHasher [] [src]

pub struct ByteDigestHasher<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 slice convertible input.

The hash function implementation is defined by the first type parameter. In contrast to the more generic DigestHasher, the parameter type is bound by bytestream-oriented digest::Input, so any cryptographic digest function implementations conformant to this trait, plus digest::FixedOutput and Default, are directly usable.

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> ByteDigestHasher<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> ByteDigestHasher<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 ByteDigestHasher<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 ByteDigestHasher<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 ByteDigestHasher<D, Nh> where
    D: 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 ByteDigestHasher<D, Nh> where
    In: AsRef<[u8]>,
    D: Default,
    D: Input + FixedOutput,
    Nh: NodeHasher<HashOutput = GenericArray<u8, D::OutputSize>>, 
[src]

[src]

Hash an element of the input data. Read more

impl<D, Nh> NodeHasher for ByteDigestHasher<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