[−][src]Struct sha2_const::Sha512_256
The SHA-512/256 hash function.
The SHA-512 algorithm with the SHA-512/256 initialization vector, truncated to 256 bits.
Examples
const DIGEST: [u8; 32] = Sha512_256::new() .update(b"The quick brown fox ") .update(b"jumps over the lazy dog") .finalize(); assert_eq!( hex::encode(&DIGEST[..]), "dd9d67b371519c339ed8dbd25af90e976a1eeefd4ad3d889005e532fc5bef04d" );
Methods
impl Sha512_256[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; 32][src]
Finalize the context and compute the digest.
Trait Implementations
impl Clone for Sha512_256[src]
fn clone(&self) -> Sha512_256[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,