2cw/passgen

Class used for generating passwords satisfying certain conditions.

Installs: 640

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Forks: 0

pkg:composer/2cw/passgen

1.0.3 2023-01-18 17:35 UTC

This package is not auto-updated.

Last update: 2025-10-09 07:04:51 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