[][src]Struct sha2_const::Sha512_224

pub struct Sha512_224 { /* fields omitted */ }

The SHA-512/224 hash function.

The SHA-512 algorithm with the SHA-512/224 initialization vector, truncated to 224 bits.

Examples

const DIGEST: [u8; 28] = Sha512_224::new()
    .update(b"The quick brown fox ")
    .update(b"jumps over the lazy dog")
    .finalize();

assert_eq!(
    hex::encode(&DIGEST[..]),
    "944cd2847fb54558d4775db0485a50003111c8e5daa63fe722c6aa37"
);

Methods

impl Sha512_224[src]

pub const BLOCK_SIZE: usize[src]

The internal block size of the hash function.

pub const DIGEST_SIZE: usize[src]

The digest size of the hash function.

pub const fn new() -> Self[src]

Construct a new instance.

#[must_use]pub const fn update(self, input: &[u8]) -> Self[src]

Add input data to the hash context.

#[must_use]pub const fn finalize(self) -> [u8; 28][src]

Finalize the context and compute the digest.

Trait Implementations

impl Clone for Sha512_224[src]

Auto Trait Implementations

impl Send for Sha512_224

impl Sync for Sha512_224

impl Unpin for Sha512_224

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.