pub trait Hash {
// Required methods
fn digest_size(&self) -> usize;
fn update(&mut self, data: &[u8]);
fn digest(&mut self, digest: &mut [u8]);
fn box_clone(&self) -> Box<dyn Hash>;
}
Expand description
Hash function.
Cryptographic hash functions compute a fixed length checksum (also called digest) from variable length data.
Required Methods§
sourcefn digest_size(&self) -> usize
fn digest_size(&self) -> usize
Size of the digest in bytes
Trait Implementations§
source§impl Hash for Box<dyn Hash>
impl Hash for Box<dyn Hash>
source§impl Write for dyn Hash
impl Write for dyn Hash
source§fn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
Write a buffer into this writer, returning how many bytes were written. Read more
source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flush this output stream, ensuring that all intermediately buffered
contents reach their destination. Read more
source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector
)1.0.0 · source§fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this writer. Read more