pub struct Hash(/* private fields */);Expand description
Output of the SHA256 hash function.
Implementations§
Source§impl Hash
impl Hash
Sourcepub fn forward_hex(&self) -> impl '_ + LowerHex + UpperHex
pub fn forward_hex(&self) -> impl '_ + LowerHex + UpperHex
Displays hex forwards, regardless of how this type would display it naturally.
This is mainly intended as an internal method and you shouldn’t need it unless you’re doing something special.
Sourcepub fn backward_hex(&self) -> impl '_ + LowerHex + UpperHex
pub fn backward_hex(&self) -> impl '_ + LowerHex + UpperHex
Displays hex backwards, regardless of how this type would display it naturally.
This is mainly intended as an internal method and you shouldn’t need it unless you’re doing something special.
Sourcepub fn from_bytes_ref(bytes: &[u8; 32]) -> &Self
pub fn from_bytes_ref(bytes: &[u8; 32]) -> &Self
Zero cost conversion between a fixed length byte array shared reference and a shared reference to this Hash type.
Sourcepub fn from_bytes_mut(bytes: &mut [u8; 32]) -> &mut Self
pub fn from_bytes_mut(bytes: &mut [u8; 32]) -> &mut Self
Zero cost conversion between a fixed length byte array exclusive reference and an exclusive reference to this Hash type.
Source§impl Hash
impl Hash
Sourcepub fn hash_again(&self) -> Hash
pub fn hash_again(&self) -> Hash
Iterate the sha256 algorithm to turn a sha256 hash into a sha256d hash
Sourcepub const fn const_hash(bytes: &[u8]) -> Self
pub const fn const_hash(bytes: &[u8]) -> Self
Computes hash from bytes in const context.
Warning: this function is inefficient. It should be only used in const context.
Trait Implementations§
Source§impl Hash for Hash
impl Hash for Hash
Source§const DISPLAY_BACKWARD: bool = false
const DISPLAY_BACKWARD: bool = false
Sha256dHash, so here we are.Source§type Engine = HashEngine
type Engine = HashEngine
io::Write trait, and to never return errors under
any conditions.