Trait sha2::Digest
[−]
[src]
pub trait Digest {
type OutputSize: ArrayLength<u8>;
type BlockSize: ArrayLength<u8>;
fn input(&mut self, input: &[u8]);
fn result(self) -> GenericArray<u8, Self::OutputSize>;
fn block_bytes(&self) -> usize { ... }
fn block_bits(&self) -> usize { ... }
fn output_bytes(&self) -> usize { ... }
fn output_bits(&self) -> usize { ... }
}The Digest trait specifies an interface common to digest functions
Associated Types
type OutputSize: ArrayLength<u8>
type BlockSize: ArrayLength<u8>
Required Methods
fn input(&mut self, input: &[u8])
Digest input data. This method can be called repeatedly for use with streaming messages.
fn result(self) -> GenericArray<u8, Self::OutputSize>
Retrieve the digest result. This method consumes digest instance.
Provided Methods
fn block_bytes(&self) -> usize
Get the block size in bytes.
fn block_bits(&self) -> usize
Get the block size in bits.
fn output_bytes(&self) -> usize
Get the output size in bytes.
fn output_bits(&self) -> usize
Get the output size in bits.
Implementors
impl Digest for Sha256 type OutputSize = U32; type BlockSize = U64;impl Digest for Sha224 type OutputSize = U28; type BlockSize = U64;impl Digest for Sha512 type OutputSize = U64; type BlockSize = U128;impl Digest for Sha384 type OutputSize = U48; type BlockSize = U128;impl Digest for Sha512Trunc256 type OutputSize = U32; type BlockSize = U128;impl Digest for Sha512Trunc224 type OutputSize = U28; type BlockSize = U128;