pub struct Sha256 { /* private fields */ }Expand description
The SHA-256 hash function.
§Examples
const DIGEST: [u8; 32] = Sha256::new()
.update(b"The quick brown fox ")
.update(b"jumps over the lazy dog")
.finalize();
assert_eq!(
hex::encode(&DIGEST[..]),
"d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592"
);Implementations§
Source§impl Sha256
impl Sha256
Sourcepub const BLOCK_SIZE: usize = sha::Sha256::BLOCK_SIZE
pub const BLOCK_SIZE: usize = sha::Sha256::BLOCK_SIZE
The internal block size of the hash function.
Sourcepub const DIGEST_SIZE: usize = 32
pub const DIGEST_SIZE: usize = 32
The digest size of the hash function.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Sha256
impl RefUnwindSafe for Sha256
impl Send for Sha256
impl Sync for Sha256
impl Unpin for Sha256
impl UnsafeUnpin for Sha256
impl UnwindSafe for Sha256
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more