Struct qwerty::Qwerty [−][src]
pub struct Qwerty { /* fields omitted */ }
A password generator. Once Qwerty
has been initialized
with the desired password properties the terminal function
generate
can be called to get a password.
Examples
use qwerty::{Qwerty, Distribution}; let password = Qwerty::new(Distribution::Alphanumeric, 32).generate();
Methods
impl Qwerty
[src]
impl Qwerty
pub fn new(distribution: Distribution, num_tokens: usize) -> Qwerty
[src]
pub fn new(distribution: Distribution, num_tokens: usize) -> Qwerty
Create a new Qwerty
password generator.
Examples
The following will create a password generator that uses
the Ascii
uniform distribution over the ASCII charachters,
numbers, and symbols. It also sets the password length to be
- Once the terminal function
generate()
is called it will return a password with these properties.
use qwerty::{Qwerty, Distribution}; let ascii_password_generator = Qwerty::new(Distribution::Ascii, 25); let password = ascii_password_generator.generate(); println!("{}", password);
pub fn generate(&self) -> String
[src]
pub fn generate(&self) -> String
Generate a password.
Examples
The following will generate a password using the EFF diceware long word list that is 8 words long.
use qwerty::{Qwerty, Distribution}; let password = Qwerty::new(Distribution::EffDiceware, 8).generate(); println!("{}", password);