pub struct Sha256Hasher(/* private fields */);Available on crate feature
sha2 only.Expand description
SHA-256 Hasher.
The most common production hasher for audit-trail. SHA-256 is a FIPS 180-4 standard primitive, 32-byte output, widely accepted by HIPAA, SOC 2, PCI-DSS, and other compliance frameworks.
§Example
use audit_trail::{Digest, Hasher, Sha256Hasher};
let mut hasher = Sha256Hasher::new();
hasher.update(b"audit-trail");
let mut out = Digest::ZERO;
hasher.finalize(&mut out);
// SHA-256("audit-trail") = 4e9b…
assert_ne!(out, Digest::ZERO);Implementations§
Source§impl Sha256Hasher
impl Sha256Hasher
Sourcepub fn new() -> Self
Available on crate features sha2 or blake3 only.
pub fn new() -> Self
sha2 or blake3 only.Construct a fresh Sha256Hasher.
Trait Implementations§
Source§impl Clone for Sha256Hasher
Available on crate features sha2 or blake3 only.
impl Clone for Sha256Hasher
Available on crate features
sha2 or blake3 only.Source§fn clone(&self) -> Sha256Hasher
fn clone(&self) -> Sha256Hasher
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Sha256Hasher
Available on crate features sha2 or blake3 only.
impl Debug for Sha256Hasher
Available on crate features
sha2 or blake3 only.Source§impl Default for Sha256Hasher
Available on crate features sha2 or blake3 only.
impl Default for Sha256Hasher
Available on crate features
sha2 or blake3 only.Source§fn default() -> Sha256Hasher
fn default() -> Sha256Hasher
Returns the “default value” for a type. Read more
Source§impl Hasher for Sha256Hasher
Available on crate features sha2 or blake3 only.
impl Hasher for Sha256Hasher
Available on crate features
sha2 or blake3 only.Auto Trait Implementations§
impl Freeze for Sha256Hasher
impl RefUnwindSafe for Sha256Hasher
impl Send for Sha256Hasher
impl Sync for Sha256Hasher
impl Unpin for Sha256Hasher
impl UnsafeUnpin for Sha256Hasher
impl UnwindSafe for Sha256Hasher
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