[][src]Crate mkpasswd

mkpasswd - Library and command-line tool to generate passwords

Command line tool

Install the command line tool with cargo install mkpasswd. You can then use the mkpasswd command, run it with --help to get more information.

Library

The library exposes only a few functions dedicated to random password generation.

  • If you want it simple and can risk panics, use the mkpasswd function.

If you want more control and error handling, use generate and generate_with_rng. These functions take an alphabet, which is a set of characters that the password may contain.

  • The most control is offered by generate_with_rng, because it uses an external random number generator. You should this if you want to generate multiple passwords.

Re-exports

pub extern crate rand_core;
pub extern crate rand_os;
pub use alphabets::Password;

Modules

alphabets

Commonly used alphabets for password generation.

Functions

generate

Generates a length long password made of bytes from alphabet.

generate_with_rng

Generates a length long password made of bytes from alphabet using random data provided by rng.

mkpasswd

Generates an UTF-8 valid password with a length of 32 characters.