pub struct Hasher { /* private fields */ }Expand description
Universal hasher supporting multiple algorithms
Implementations§
Source§impl Hasher
impl Hasher
Sourcepub fn new(algorithm: HashAlgorithm) -> Self
pub fn new(algorithm: HashAlgorithm) -> Self
Create a new hasher with the specified algorithm
Sourcepub fn hash(&self, data: &[u8]) -> HashOutput
pub fn hash(&self, data: &[u8]) -> HashOutput
Hash data and return output
Sourcepub fn hash_str(&self, data: &str) -> HashOutput
pub fn hash_str(&self, data: &str) -> HashOutput
Hash string data
Sourcepub fn hash_to_hex(&self, data: &[u8]) -> String
pub fn hash_to_hex(&self, data: &[u8]) -> String
Hash and return hex string
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Hasher
impl RefUnwindSafe for Hasher
impl Send for Hasher
impl Sync for Hasher
impl Unpin for Hasher
impl UnwindSafe for Hasher
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