2cw / passgen
Class used for generating passwords satisfying certain conditions.
1.0.3
2023-01-18 17:35 UTC
Requires
- php: >=7.0
This package is not auto-updated.
Last update: 2025-12-04 07:37:42 UTC
README
Usage
$passGen = new \_2cW\PasswordGenerator\PasswordGenerator();
$passGen->digits(2);
The digits method ensures that the password will have specified number of digits.
$passGen = new \_2cW\PasswordGenerator\PasswordGenerator();
$passGen->lowerCaseLetters(2);
The lowerCaseLetters method ensures that the password will have specified number of lower case characters.
$passGen = new \_2cW\PasswordGenerator\PasswordGenerator();
$passGen->upperCaseLetters(2);
The upperCaseLetters method ensures that the password will have specified number of upper case characters.
$passGen = new \_2cW\PasswordGenerator\PasswordGenerator();
$passGen->specialChars(2);
The specialChars method ensures that the password will have specified number of special characters.
$passGen = new \_2cW\PasswordGenerator\PasswordGenerator();
$passGen->digits(2)
->lowerCaseLetters(1)
->upperCaseLetters(1)
->specialChars(2);
$passGen->generatePassword(15);
The generatePassword method generates password according to rules set, having specified number of characters (in this case - 15).
(c) 2020 2cW.pl