Crates.io | pw-gen |
lib.rs | pw-gen |
version | 0.1.2 |
source | src |
created_at | 2023-05-30 13:34:18.522349 |
updated_at | 2023-05-30 14:39:33.104027 |
description | A password generator |
homepage | |
repository | https://github.com/gordug/pw-gen.git |
max_upload_size | |
id | 877905 |
size | 14,145 |
Password Generator Rust Library
Required password length is passed into new, while the special, numerical, lower and upper case calls have an optional required setting, assuring the generated password contains at least 1 character from each set.
fn main() {
let password = Generator::new(10)
.with_special(Some(true))
.with_numbers(Some(true))
.with_lowercase(Some(true))
.with_uppercase(Some(true))
.without_similar()
.without_ambiguous()
.without_sequential()
.generate();
println!("{}",password);
}
0.1.0 has no checks on length so requiring all 4 and setting too short a password will cause the method to loop indefinitely.
0.1.1 no sequential support is missing.