4 releases (2 breaking)
0.3.1 | Nov 16, 2019 |
---|---|
0.3.0 | Nov 16, 2019 |
0.2.0 | Nov 16, 2019 |
0.1.0 | Nov 16, 2019 |
#893 in Authentication
120KB
8K
SLoC
genp
This crate provides functions for generating passwords from a character list or passphrases from a word list. Some character and word lists are exported by this crate to use when you don't want to supply your own.
Examples
Password
use genp::password;
use genp::charlist::{LOWERCASE, NUMBERS, UPPERCASE};
let len = 26;
let mut charlist = Vec::new();
charlist.extend_from_slice(&LOWERCASE);
charlist.extend_from_slice(&NUMBERS);
charlist.extend_from_slice(&UPPERCASE);
println!("{}", password(&charlist, len));
Passphrase
use genp::passphrase;
use genp::wordlist::ENGLISH;
let len = 12;
println!("{}", passphrase(&ENGLISH, len));
lib.rs
:
genp
This crate provides functions for generating passwords from a character list or passphrases from a word list. Some character and word lists are exported by this crate to use when you don't want to supply your own.
Password
use genp::password;
use genp::charlist::{LOWERCASE, NUMBERS, UPPERCASE};
let len = 26;
let mut charlist = Vec::new();
charlist.extend_from_slice(&LOWERCASE);
charlist.extend_from_slice(&NUMBERS);
charlist.extend_from_slice(&UPPERCASE);
println!("{}", password(&charlist, len));
Passphrase
use genp::passphrase;
use genp::wordlist::ENGLISH;
let len = 12;
println!("{}", passphrase(&ENGLISH, len));
Dependencies
~1.4–2MB
~37K SLoC