Trait pythnet_sdk::hashers::Hasher
source · pub trait Hasher{
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§
type Hash: Copy + AsRef<[u8]> + BorshSerialize + BorshDeserialize + Debug + Default + Eq + Hash + PartialOrd + PartialEq + Serialize + for<'a> Deserialize<'a>
Required Methods§
Object Safety§
This trait is not object safe.