simple-pass-gen

Crates.iosimple-pass-gen
lib.rssimple-pass-gen
version0.1.8
sourcesrc
created_at2023-05-21 09:12:06.171526
updated_at2023-05-21 09:56:16.77996
descriptionSimple-Pass-Gen is a password generator library.
homepage
repository
max_upload_size
id869846
size6,728
Andrei Dodu (goto-eof)

documentation

README

Simple Pass Gen

Simple Pass Gen is a simple password generator library.

How to use it?

In order to use it first of all add simple-pass-gen to your Cargo.toml file:

simple-pass-gen = "0.1.8"

Then call one of two available functions:

pub fn generate_password(
    password_length: i32,
    include_upper_case: bool,
    include_lower_case: bool,
    include_numbers: bool,
    include_symbols: bool,
) -> Result<String, SimplePassGenError>;

or if you want to generate a easy to remember password

pub fn generate_mnemonic_password(password_length: i32) 
-> Result<String, SimplePassGenError>

Example

use simple_pass_gen::generate_mnemonic_password;
use simple_pass_gen::generate_password;

fn main() {
    let result = generate_mnemonic_password(5).unwrap();
    println!("{}", result);
    
    let result2 = generate_password(5, true, true, true, false).unwrap();
    println!("{}", result2);
}

p.s. this is my first library on crates.io (:

Commit count: 0

cargo fmt