Trait pythnet_sdk::hashers::Hasher

source ·
pub trait Hasher
where Self: Clone + Debug + Default,
{ type Hash: Copy + AsRef<[u8]> + BorshSerialize + BorshDeserialize + Debug + Default + Eq + Hash + PartialOrd + PartialEq + Serialize + for<'a> Deserialize<'a>; // Required method fn hashv(data: &[impl AsRef<[u8]>]) -> Self::Hash; }
Expand description

We provide Hasher as a small hashing abstraction.

This trait allows us to use a more abstract idea of hashing than the Digest trait from the digest create provides. In particular, if we want to use none cryptographic hashes or hashes that fit the mathematical definition of a hash, we can do this with this far more general abstraction.

Required Associated Types§

Required Methods§

source

fn hashv(data: &[impl AsRef<[u8]>]) -> Self::Hash

Object Safety§

This trait is not object safe.

Implementors§