Trait sha1::Digest

source ·
pub trait Digest: OutputSizeUser {
    fn new() -> Self;
    fn new_with_prefix(data: impl AsRef<[u8]>) -> Self;
    fn update(&mut self, data: impl AsRef<[u8]>);
    fn chain_update(self, data: impl AsRef<[u8]>) -> Self;
    fn finalize(self) -> GenericArray<u8, Self::OutputSize>;
    fn finalize_into(self, out: &mut GenericArray<u8, Self::OutputSize>);
    fn finalize_reset(&mut self) -> GenericArray<u8, Self::OutputSize>
        Self: FixedOutputReset
; fn finalize_into_reset(
        &mut self,
        out: &mut GenericArray<u8, Self::OutputSize>
        Self: FixedOutputReset
; fn reset(&mut self)
        Self: Reset
; fn output_size() -> usize; fn digest(data: impl AsRef<[u8]>) -> GenericArray<u8, Self::OutputSize>; }
Expand description

Convenience wrapper trait covering functionality of cryptographic hash functions with fixed output size.

This trait wraps Update, FixedOutput, Default, and HashMarker traits and provides additional convenience methods.

Required Methods§

Create new hasher instance.

Create new hasher instance which has processed the provided data.

Process data, updating the internal state.

Process input data in a chained manner.

Retrieve result and consume hasher instance.

Write result into provided array and consume the hasher instance.

Retrieve result and reset hasher instance.

Write result into provided array and reset the hasher instance.

Reset hasher instance to its initial state.

Get output size of the hasher

Compute hash of data.