pub struct Sha256(/* private fields */);
Expand description
An object which calculates a SHA256 hash of some data.
Implementations§
source§impl Sha256
impl Sha256
sourcepub fn new() -> Sha256
pub fn new() -> Sha256
Creates a new hasher.
This corresponds to SHA256_Init
.
sourcepub fn update(&mut self, buf: &[u8])
pub fn update(&mut self, buf: &[u8])
Feeds some data into the hasher.
This can be called multiple times.
This corresponds to SHA256_Update
.
sourcepub fn finish(self) -> [u8; 32]
pub fn finish(self) -> [u8; 32]
Returns the hash of the data.
This corresponds to SHA256_Final
.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Sha256
impl Send for Sha256
impl Sync for Sha256
impl Unpin 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