Hasher

Trait Hasher 

Source
pub trait Hasher: Send + Sync {
    // Required methods
    fn hash<'life0, 'life1, 'async_trait>(
        &'life0 self,
        data: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<Multihash<64>, HeliaError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn code(&self) -> u64;
}
Expand description

Multihash hasher trait

Required Methods§

Source

fn hash<'life0, 'life1, 'async_trait>( &'life0 self, data: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<Multihash<64>, HeliaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Hash data using this hasher

Source

fn code(&self) -> u64

Get the hasher code

Implementors§