pub struct Digest {
pub bytes: ArrayVec<[u8; 64]>,
}
Expand description
A finalized BLAKE2 hash.
Digest
supports constant-time equality checks, for cases where BLAKE2 is
being used as a MAC. It uses an
ArrayVec
to hold various digest lengths without needing to allocate on the heap.
Fields§
§bytes: ArrayVec<[u8; 64]>
Implementations§
Source§impl Digest
impl Digest
Sourcepub fn hex(&self) -> ArrayString<[u8; 128]>
pub fn hex(&self) -> ArrayString<[u8; 128]>
Convert the digest to a hexadecimal string. Because we know the maximum
length of the string in advance (2 * OUTBYTES
), we can use an
ArrayString
to avoid allocating.
Trait Implementations§
Source§impl PartialEq for Digest
This implementation is constant time, if the two digests are the same
length.
impl PartialEq for Digest
This implementation is constant time, if the two digests are the same length.
impl Eq for Digest
Auto Trait Implementations§
impl Freeze for Digest
impl RefUnwindSafe for Digest
impl Send for Digest
impl Sync for Digest
impl Unpin for Digest
impl UnwindSafe for Digest
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