Crates.io | libpassgen |
lib.rs | libpassgen |
version | 1.0.3 |
source | src |
created_at | 2022-04-03 03:19:22.063867 |
updated_at | 2022-04-03 11:47:12.745497 |
description | Library for generating passwords |
homepage | https://github.com/Antidote1911/libpassgen |
repository | https://github.com/Antidote1911/libpassgen |
max_upload_size | |
id | 561166 |
size | 31,101 |
Crate to generate pseudo-random passwords.
This is the Passgen core. A cli app to generate passwords.
Generate a 15 chars password with the given "pool" :
use libpassgen::*;
fn main() {
let mut pool = Pool::new();
pool.extend_from_string("123456789");
let password = generate_password(&pool, 15);
println!("{}",password);
}
Generate 100 passwords with 15 chars with the given "pool" :
use std::str::FromStr;
use libpassgen::*;
fn main() {
let mut pool = Pool::from_str("1234567").unwrap();
let vec_passwords = generate_n_passwords(&pool, 15, 100);
for n in 0..vec_passwords.len() {
println!("{}",vec_passwords[n]);
}
}
Have a look to Passgen cli app for full example.