pub struct TentHash { /* private fields */ }Expand description
Computes TentHash incrementally, taking input data in chunks.
The hash output is unaffected by how the input data is split into chunks. For example, the data can be passed a byte at a time or all at once, and the hash output will be the same.
However, chunk size does affect performance, with larger chunks being faster.
§Example
// As one chunk.
let mut hasher1 = TentHash::new();
hasher1.update("Hello world!");
let hash1 = hasher1.finalize();
// As multiple chunks.
let mut hasher2 = TentHash::new();
hasher2.update("Hello");
hasher2.update(" world!");
let hash2 = hasher2.finalize();
assert_eq!(&hash1[..4], &[0x15, 0x5f, 0xa, 0x35]);
assert_eq!(hash1, hash2);Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TentHash
impl RefUnwindSafe for TentHash
impl Send for TentHash
impl Sync for TentHash
impl Unpin for TentHash
impl UnwindSafe for TentHash
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