[−][src]Trait secp256kfun::hash::HashInto
Anything that can be hashed.
The implementations of this trait decide how the type will be converted into bytes so that it can be included in the hash.
Example
use digest::Digest; use secp256kfun::hash::{HashAdd, HashInto}; struct CryptoData([u8; 42]); impl HashInto for CryptoData { fn hash_into(&self, hash: &mut impl digest::Digest) { hash.update(&self.0[..]) } } let cryptodata = CryptoData([42u8; 42]); let hash = sha2::Sha256::default().add(&cryptodata).finalize();
Required methods
fn hash_into(&self, hash: &mut impl Digest)
Asks the item to convert itself to bytes and add itself to hash
.