pub trait Hasher {
    type Output;

    fn hash(input: &[u8]) -> Self::Output;
}
Expand description

Trait you need to implement for the various hash functions you need to provide. Currently only a single function, that computes the hash of a string slice, is needed. This may change in a later version.

Beware: There is currently no way to put constraints on associated constants in Rust, so Block Size is not exposed. It’s anyhow the same (currently hardcoded) value for all supported algorithms.

Required Associated Types§

The output type of the respective hash function. Typically some form of byte array.

Required Methods§

Function that takes a byte array as input, and generates the cryptographic hash of it as output.

Implementors§