-
Notifications
You must be signed in to change notification settings - Fork 0
validatePool
Corey Avis edited this page Sep 23, 2026
·
2 revisions
Pre-validates the integrity of the built character pool before password generation begins. It ensures that no active character category required by the configuration has been completely removed by exclusions.
validatePool(string $pool): bool
pool (string) : The compiled and filtered master character pool to validate.
(bool)
: Returns true on success.
The method performs a "fail-fast" check using regular expressions against the $pool variable:
- Lowercase letters must always be present.
- If
uppercaseis enabled, at least one uppercase letter must exist in the pool. - If
numbersis enabled, at least one number must exist in the pool. - If
symbolsis enabled, at least one symbol must exist in the pool.
$sec->validatePool('abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789!@#$%^*+-=_.,?:;()') = true
| Config Key | Default Value | Allowed Values | Description |
|---|---|---|---|
| numbers | true | bool | Allow numbers in password generation. |
| symbols | true | bool | Allow symbols in password generation. (!@#$%^*+-=_.,?:;()) |
| uppercase | true | bool | Allow uppercase letters in password generation. |
- Throws an exception if all lowercase letters are excluded.
- Throws an exception if all uppercase letters are excluded when
uppercaseis enabled. - Throws an exception if all numbers are excluded when
numbersis enabled. - Throws an exception if all symbols are excluded when
symbolsis enabled.
Home | CoreySecurity | Helpers