Updates the hasher with more data.
(&mut self, data: &[u8])
| 522 | |
| 523 | /// Updates the hasher with more data. |
| 524 | pub fn update(&mut self, data: &[u8]) -> &mut Self { |
| 525 | unsafe { |
| 526 | sz_hash_state_update( |
| 527 | self as *mut _ as *mut c_void, |
| 528 | data.as_ptr() as *const c_void, |
| 529 | data.len(), |
| 530 | ); |
| 531 | } |
| 532 | self |
| 533 | } |
| 534 | |
| 535 | /// Returns the current hash value without consuming the state. |
| 536 | pub fn digest(&self) -> u64 { |