BinaryHash

Trait BinaryHash 

Source
pub trait BinaryHash {
    // Required method
    fn hash(input: &[u8]) -> [u8; 32];

    // Provided method
    fn hash2_32_concat(left: &[u8; 32], right: &[u8; 32]) -> [u8; 32] { ... }
}
Expand description

A simple trait for representing binary hash functions.

Required Methods§

Source

fn hash(input: &[u8]) -> [u8; 32]

Given a bit-string, produce a 32-bit hash.

Provided Methods§

Source

fn hash2_32_concat(left: &[u8; 32], right: &[u8; 32]) -> [u8; 32]

An optional specialization of hash where there are two 32-byte inputs, left and right.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl BinaryHash for Blake3BinaryHasher

Source§

impl BinaryHash for Sha2BinaryHasher

Source§

impl<H: Digest<OutputSize = U32> + Send + Sync> BinaryHash for H

Blanket implementation for all implementations of Digest