pub struct HashOutput { /* private fields */ }Expand description
Hash output wrapper
Implementations§
Source§impl HashOutput
impl HashOutput
Sourcepub fn from_bytes(
algorithm: HashAlgorithm,
bytes: Vec<u8>,
) -> Result<Self, HashError>
pub fn from_bytes( algorithm: HashAlgorithm, bytes: Vec<u8>, ) -> Result<Self, HashError>
Create from raw bytes
Sourcepub fn algorithm(&self) -> HashAlgorithm
pub fn algorithm(&self) -> HashAlgorithm
Get algorithm used
Sourcepub fn verify_hex(&self, expected_hex: &str) -> bool
pub fn verify_hex(&self, expected_hex: &str) -> bool
Verify against hex string (constant-time)
Trait Implementations§
Source§impl Clone for HashOutput
impl Clone for HashOutput
Source§fn clone(&self) -> HashOutput
fn clone(&self) -> HashOutput
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HashOutput
impl Debug for HashOutput
Source§impl<'de> Deserialize<'de> for HashOutput
impl<'de> Deserialize<'de> for HashOutput
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for HashOutput
impl PartialEq for HashOutput
Source§impl Serialize for HashOutput
impl Serialize for HashOutput
impl Eq for HashOutput
impl StructuralPartialEq for HashOutput
Auto Trait Implementations§
impl Freeze for HashOutput
impl RefUnwindSafe for HashOutput
impl Send for HashOutput
impl Sync for HashOutput
impl Unpin for HashOutput
impl UnwindSafe for HashOutput
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