Struct mini_functions::password::Password
source · #[non_exhaustive]pub struct Password { /* private fields */ }Expand description
A random password / passphrase generator. The generated password is a string of three words separated by hyphens. Each word is between 6 and 8 characters long. The first character of each word is capitalized.
Implementations§
source§impl Password
impl Password
sourcepub fn entropy(&self) -> f64
pub fn entropy(&self) -> f64
Calculates the entropy of the generated passphrase. Returns the entropy as a f64.
sourcepub fn hash_length(&self) -> usize
pub fn hash_length(&self) -> usize
Returns the hash length.
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if the generated passphrase is empty. Returns false if the generated passphrase is not empty.
sourcepub fn new(len: u8, separator: &str, special_chars: Vec<char>) -> Self
pub fn new(len: u8, separator: &str, special_chars: Vec<char>) -> Self
Generates a random passphrase.
sourcepub fn passphrase(&self) -> &str
pub fn passphrase(&self) -> &str
Returns the generated passphrase.
sourcepub fn password_length(&self) -> usize
pub fn password_length(&self) -> usize
Returns the password length.
sourcepub fn set_passphrase(&mut self, passphrase: &str)
pub fn set_passphrase(&mut self, passphrase: &str)
Sets the generated passphrase.
Trait Implementations§
source§impl PartialEq<Password> for Password
impl PartialEq<Password> for Password
source§impl PartialOrd<Password> for Password
impl PartialOrd<Password> for Password
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 Password
Auto Trait Implementations§
impl RefUnwindSafe for Password
impl Send for Password
impl Sync for Password
impl Unpin for Password
impl UnwindSafe for Password
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().