pants-gen
Password generator, used for pants.
Usage
A password generator that can be used as a library or at the command line
When using from the command line can either provide a spec string, or override the default (or current spec string) with other arguments.
CLI examples
Using the default spec
};||
Overriding the default spec to be:
- 3 or more uppercase letters
- 1 to 2 lowercase letters
- 3 or fewer numbers
- 1 symbol
- password of length 16
)
Overriding parts of the default spec
- setting the length to be 12
)
Setting custom charater groups
- disabling the symbols
- setting an equivalent set of symbols to be !@#$%^&*|_+-=
=LsI8=@#dj9&
Library examples
To generate a password build up the spec and then call generate to produce the password. This
function returns an Option since the constraints on the provided choices can't always meet
the length requirement given.
use ;
use Interval;
let spec = new
.length
.upper_at_least
.lower
.include
.custom;
if let Some = spec.generate else