Download the PHP package adgodev/xkpasswd-php without Composer
On this page you can find all versions of the php package adgodev/xkpasswd-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package xkpasswd-php
xkpasswd
Memorable password generator, inspired by a PERL module powering xkpasswd.net/s/
Based heavily on the xkpasswd-node package. Also a nod to battery-staple for the inspiration.
Install
Usage
You can use xkpasswd as a module in your application.
EXAMPLES
Options
You can specify complexity
argument in accordance with complexity levels table. Defaults to 2.
If specified pattern
argument overrides the pattern derived from complexity level.
If separators
are provided they are used instead of the standard set (see complexity levels).
One separator is used per password, picked randomly from the provided set.
You can set transform
option to alternate
or uppercase
to trigger case transformation.
Finally if you'd like to use a custom list of words you can provide it
as a JSON file, text file or an array via wordList
function.
EXAMPLE Default behaviour
EXAMPLE Specify complexity
EXAMPLE Specify custom pattern
EXAMPLE Specify custom word list / dictionary
Patterns
Patterns can consist of any combination of words, digits and separators. The first letters (w, d and s respectively) are used in pattern string provided to the password generation function.
For example:
w
will return a single word (i.e.demographics
). Usew
for lowercase andW
for uppercase.wsd
will return a word and a digit, separated by one of the permitted separators (i.e.storm#7
)wswsdd
will return two words followed by a two digit number, all with separators between (i.e.delates+dissembled+16
)
Complexity levels
There are 6 complexity levels specified which can be used to provide default patterns as well as trigger additional features, such as alternate casing between words and expanded sets of separators.
Complexity | Pattern | Separators |
---|---|---|
1 | wsw | #.-=+_ |
2 | wswsw | #.-=+_ |
3 | wswswsdd | #.-=+_ |
4 | wswswswsdd | #.-=+_ |
5 | wswswswswsd | #.-=+_!$*:~? |
6 | ddswswswswswsdd | #.-=+_!$*:~?%^&; |
In addition level 6 alternates upper and lower case between words.
Release notes
v1.0.0
Initial release