pub struct Digest { /* private fields */ }Expand description
Represents a CRC Digest, which is used to compute CRC checksums.
The Digest struct maintains the state of the CRC computation, including
the current state, the amount of data processed, the CRC parameters, and
the calculator function used to perform the CRC calculation.
Implementations§
Source§impl Digest
impl Digest
Sourcepub fn new(algorithm: CrcAlgorithm) -> Self
pub fn new(algorithm: CrcAlgorithm) -> Self
Creates a new Digest instance for the specified CRC algorithm.
Sourcepub fn finalize_reset(&mut self) -> u64
pub fn finalize_reset(&mut self) -> u64
Finalizes the CRC computation, resets the state, and returns the result.
Sourcepub fn get_amount(&self) -> u64
pub fn get_amount(&self) -> u64
Gets the amount of data processed so far
Trait Implementations§
Source§impl DynDigest for Digest
impl DynDigest for Digest
Source§fn finalize_into(self, buf: &mut [u8]) -> Result<(), InvalidBufferSize>
fn finalize_into(self, buf: &mut [u8]) -> Result<(), InvalidBufferSize>
Write result into provided array and consume the hasher instance. Read more
Source§fn finalize_into_reset(
&mut self,
out: &mut [u8],
) -> Result<(), InvalidBufferSize>
fn finalize_into_reset( &mut self, out: &mut [u8], ) -> Result<(), InvalidBufferSize>
Write result into provided array and reset the hasher instance. Read more
Source§fn output_size(&self) -> usize
fn output_size(&self) -> usize
Get output size of the hasher
Source§fn finalize_reset(&mut self) -> Box<[u8]>
fn finalize_reset(&mut self) -> Box<[u8]>
Retrieve result and reset hasher instance
Source§impl Write for Digest
impl Write for Digest
Source§fn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
Writes a buffer into this writer, returning how many bytes were written. Read more
Source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flushes this output stream, ensuring that all intermediately buffered
contents reach their destination. Read more
Source§fn write_all(&mut self, buf: &[u8]) -> Result<()>
fn write_all(&mut self, buf: &[u8]) -> Result<()>
Attempts to write an entire buffer into this writer. Read more
Source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector)Source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
🔬This is a nightly-only experimental API. (
write_all_vectored)Attempts to write multiple buffers into this writer. Read more
impl Copy for Digest
Auto Trait Implementations§
impl Freeze for Digest
impl RefUnwindSafe for Digest
impl Send for Digest
impl Sync for Digest
impl Unpin for Digest
impl UnwindSafe for Digest
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