[−][src]Trait crypto::digest::Digest
The Digest trait specifies an interface common to digest functions, such as SHA-1 and the SHA-2 family of digest functions.
Required methods
fn input(&mut self, input: &[u8])
fn result(&mut self, out: &mut [u8])
Retrieve the digest result. This method may be called multiple times.
Arguments
- out - the vector to hold the result. Must be large enough to contain output_bits().
fn reset(&mut self)
Reset the digest. This method must be called after result() and before supplying more data.
fn output_bits(&self) -> usize
Get the output size in bits.
fn block_size(&self) -> usize
Get the block size in bytes.
Provided methods
fn output_bytes(&self) -> usize
Get the output size in bytes.
fn input_str(&mut self, input: &str)
Convenience function that feeds a string into a digest.
Arguments
input
The string to feed into the digest
fn result_str(&mut self) -> String
Convenience function that retrieves the result of a digest as a String in hexadecimal format.
Implementors
impl Digest for Blake2b
[src]
fn reset(&mut self)
[src]
fn input(&mut self, msg: &[u8])
[src]
fn result(&mut self, out: &mut [u8])
[src]
fn output_bits(&self) -> usize
[src]
fn block_size(&self) -> usize
[src]
impl Digest for Blake2s
[src]
fn reset(&mut self)
[src]
fn input(&mut self, msg: &[u8])
[src]
fn result(&mut self, out: &mut [u8])
[src]
fn output_bits(&self) -> usize
[src]
fn block_size(&self) -> usize
[src]
impl Digest for Md5
[src]
fn input(&mut self, input: &[u8])
[src]
fn reset(&mut self)
[src]
fn result(&mut self, out: &mut [u8])
[src]
fn output_bits(&self) -> usize
[src]
fn block_size(&self) -> usize
[src]
impl Digest for Ripemd160
[src]
fn reset(&mut self)
[src]
Resets the hash to its original state also clearing the buffer. To be used in between hashing separate messages to avoid having to recreate and allocate the whole structure.
fn input(&mut self, msg: &[u8])
[src]
Adds the input msg
to the hash. This method can be called repeatedly
for use with streaming messages.
fn result(&mut self, out: &mut [u8])
[src]
Returns the resulting digest of the entire message.
Note: out
must be at least 20 bytes (160 bits)
fn output_bits(&self) -> usize
[src]
Returns the size of the digest in bits
fn block_size(&self) -> usize
[src]
Returns the block size the hash operates on in bytes