pub struct StreamingHasher { /* private fields */ }Expand description
Incremental SHA-256 or SHA-512 hasher.
This keeps hashing state inside Voided so callers can process large inputs without first assembling them into one contiguous allocation.
Implementations§
Source§impl StreamingHasher
impl StreamingHasher
Sourcepub fn new(algorithm: HashAlgorithm) -> Self
pub fn new(algorithm: HashAlgorithm) -> Self
Create an incremental hasher for algorithm.
Sourcepub fn bytes_hashed(&self) -> u128
pub fn bytes_hashed(&self) -> u128
Return the total number of bytes supplied through Self::update.
Sourcepub fn finalize_bytes(self) -> Vec<u8> ⓘ
pub fn finalize_bytes(self) -> Vec<u8> ⓘ
Consume the hasher and return the digest bytes.
Sourcepub fn finalize_hex(self) -> String
pub fn finalize_hex(self) -> String
Consume the hasher and return the lowercase hexadecimal digest.
Auto Trait Implementations§
impl Freeze for StreamingHasher
impl RefUnwindSafe for StreamingHasher
impl Send for StreamingHasher
impl Sync for StreamingHasher
impl Unpin for StreamingHasher
impl UnsafeUnpin for StreamingHasher
impl UnwindSafe for StreamingHasher
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