Struct blake2b_simd::Hash
source · pub struct Hash { /* private fields */ }
Expand description
A finalized BLAKE2 hash, with constant-time equality.
Implementations§
source§impl Hash
impl Hash
sourcepub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_bytes(&self) -> &[u8] ⓘ
Convert the hash to a byte slice. Note that if you’re using BLAKE2b as a MAC, you need
constant time equality, which &[u8]
doesn’t provide.
sourcepub fn to_hex(&self) -> ArrayString<[u8; 128]>
pub fn to_hex(&self) -> ArrayString<[u8; 128]>
Convert the hash to a lowercase hexadecimal
ArrayString
.
Trait Implementations§
source§impl PartialEq<[u8]> for Hash
impl PartialEq<[u8]> for Hash
This implementation is constant time, if the slice is the same length as the hash.
source§impl PartialEq<Hash> for Hash
impl PartialEq<Hash> for Hash
This implementation is constant time, if the two hashes are the same length.