pub struct Hash(/* private fields */);Expand description
Store and hash Argon2 hashes (compare too) When used in in hashmaps, the already hashed argon 2 digest gets re-hashed, for speed
Implementations§
Source§impl Hash
impl Hash
Sourcepub const fn new_from_buf(hash_buf: [u8; 32]) -> Self
pub const fn new_from_buf(hash_buf: [u8; 32]) -> Self
Create a new hash with a buffer of an already existing hash
Sourcepub fn compare_with_data(&self, other_data: &[u8]) -> bool
pub fn compare_with_data(&self, other_data: &[u8]) -> bool
Compare this hash with some data (check if the data hash is the same)
Sourcepub fn new_from_base36(s: &str) -> Option<Self>
pub fn new_from_base36(s: &str) -> Option<Self>
Create a new hash from a already existing hash encoded in a base36 string
pub fn dump_base36(&self) -> String
pub fn dump_buf(&self) -> [u8; 32]
Trait Implementations§
Source§impl<'__de, __Context> BorrowDecode<'__de, __Context> for Hash
impl<'__de, __Context> BorrowDecode<'__de, __Context> for Hash
Source§fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>(
decoder: &mut __D,
) -> Result<Self, DecodeError>
fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given BorrowDecode.
Source§impl<'de> Deserialize<'de> for Hash
impl<'de> Deserialize<'de> for Hash
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Hash
impl Eq for Hash
impl StructuralPartialEq for Hash
Auto Trait Implementations§
impl Freeze for Hash
impl RefUnwindSafe for Hash
impl Send for Hash
impl Sync for Hash
impl Unpin for Hash
impl UnwindSafe for Hash
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