pub struct Hash(/* private fields */);Expand description
A fixed 32-byte SHAKE-256 digest.
Implementations§
Source§impl Hash
impl Hash
Sourcepub fn new_from_bytes(bytes: &[u8]) -> Result<Self>
pub fn new_from_bytes(bytes: &[u8]) -> Result<Self>
Sourcepub fn new_from_hex(hex: &str) -> Result<Self>
pub fn new_from_hex(hex: &str) -> Result<Self>
Parse exactly 64 hexadecimal ASCII characters.
§Errors
Returns an error for the wrong length or a non-hexadecimal character.
Sourcepub fn to_short_hex(self) -> String
pub fn to_short_hex(self) -> String
Format the first eight bytes as lowercase hexadecimal text.
Trait Implementations§
impl Copy for Hash
impl Eq for Hash
Source§impl Ord for Hash
impl Ord for Hash
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Hash
impl PartialOrd for Hash
impl StructuralPartialEq for Hash
Auto Trait Implementations§
impl Forget for Hash
impl Freeze for Hash
impl Move for Hash
impl RefUnwindSafe for Hash
impl Send for Hash
impl Sync for Hash
impl Unpin for Hash
impl UnsafeUnpin for Hash
impl UnwindSafe for Hash
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more