Struct mini_functions::hash::Hash
source · #[non_exhaustive]pub struct Hash { /* private fields */ }Expand description
A struct for storing and verifying hashed passwords based on the blake3 crate.
Implementations§
source§impl Hash
impl Hash
sourcepub fn entropy(&self) -> f64
pub fn entropy(&self) -> f64
Calculates the entropy of the hash in bits based on the Shannon entropy formula. https://en.wikipedia.org/wiki/Entropy_(information_theory)
sourcepub fn generate_hash(&self) -> String
pub fn generate_hash(&self) -> String
Hashes the password.
sourcepub fn hash_length(&self) -> usize
pub fn hash_length(&self) -> usize
Returns the hash length.
sourcepub fn password_length(&self) -> usize
pub fn password_length(&self) -> usize
Returns the password length.
sourcepub fn set_password(&mut self, password: &str)
pub fn set_password(&mut self, password: &str)
Sets the password and updates the hash.
Trait Implementations§
source§impl PartialEq<Hash> for Hash
impl PartialEq<Hash> for Hash
source§impl PartialOrd<Hash> for Hash
impl PartialOrd<Hash> for Hash
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl StructuralPartialEq for Hash
Auto Trait Implementations§
impl RefUnwindSafe for Hash
impl Send for Hash
impl Sync for Hash
impl Unpin for Hash
impl UnwindSafe for Hash
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().