pub struct Digest<D: Digest> { /* private fields */ }Expand description
Utility wrapper around the final HMAC hash.
Implementations§
Source§impl<D: Digest + Copy> Digest<D>
impl<D: Digest + Copy> Digest<D>
Sourcepub const fn into_inner(self) -> D
pub const fn into_inner(self) -> D
Unwraps this Digest returning the raw byte array.
§Note
Comparing Digests should always be in constant-time, do not use into_inner prior to
checking equivalence between Digests. The Digest type’s PartialEq implementations
are all in constant-time. Either leverage these, or use this crate’s ct_eq function.
Sourcepub fn hex_encode(&self) -> HexDigest<D::Hex>
pub fn hex_encode(&self) -> HexDigest<D::Hex>
Hex-encodes the underlying digest in constant-time, returning the HexDigest type.
Trait Implementations§
impl<D: Copy + Digest> Copy for Digest<D>
impl<D: Digest> Eq for Digest<D>
Auto Trait Implementations§
impl<D> Freeze for Digest<D>where
D: Freeze,
impl<D> RefUnwindSafe for Digest<D>where
D: RefUnwindSafe,
impl<D> Send for Digest<D>where
D: Send,
impl<D> Sync for Digest<D>where
D: Sync,
impl<D> Unpin for Digest<D>where
D: Unpin,
impl<D> UnwindSafe for Digest<D>where
D: UnwindSafe,
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