Struct scoop_hash::Checksum
source · pub struct Checksum { /* private fields */ }
Expand description
Checksum is a wrapper around a hash algorithm.
Implementations§
source§impl Checksum
impl Checksum
sourcepub fn consume(&mut self, data: &[u8])
pub fn consume(&mut self, data: &[u8])
Consumes the provided data.
Examples
use scoop_hash::ChecksumBuilder;
let mut sha256 = ChecksumBuilder::new().build();
sha256.consume(b"hello world");
let result = sha256.finalize();
assert_eq!(result, "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9");
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Checksum
impl !Send for Checksum
impl !Sync for Checksum
impl Unpin for Checksum
impl !UnwindSafe for Checksum
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