tlsn_core::hash

Trait HashAlgorithm

source
pub trait HashAlgorithm {
    // Required methods
    fn id(&self) -> HashAlgId;
    fn hash(&self, data: &[u8]) -> Hash;
    fn hash_prefixed(&self, prefix: &[u8], data: &[u8]) -> Hash;
}
Expand description

A hashing algorithm.

Required Methods§

source

fn id(&self) -> HashAlgId

Returns the hash algorithm identifier.

source

fn hash(&self, data: &[u8]) -> Hash

Computes the hash of the provided data.

source

fn hash_prefixed(&self, prefix: &[u8], data: &[u8]) -> Hash

Computes the hash of the provided data with a prefix.

Implementors§