Expand description
§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
mkpasswdfunction.
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§
Modules§
- alphabets
- Commonly used alphabets for password generation.
Functions§
- generate
- Generates a
lengthlong password made of bytes fromalphabet. - generate_
with_ rng - Generates a
lengthlong password made of bytes fromalphabetusing random data provided byrng. - mkpasswd
- Generates an UTF-8 valid password with a length of 32 characters.