Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/natanael-aguiar/secure-password-generator
This PHP package allows you to generate secure passwords with configurable options, including uppercase letters, lowercase letters, numbers and special characters.
https://github.com/natanael-aguiar/secure-password-generator
php phpunit
Last synced: 5 days ago
JSON representation
This PHP package allows you to generate secure passwords with configurable options, including uppercase letters, lowercase letters, numbers and special characters.
- Host: GitHub
- URL: https://github.com/natanael-aguiar/secure-password-generator
- Owner: natanael-aguiar
- Created: 2023-10-13T16:34:23.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-13T20:02:43.000Z (over 1 year ago)
- Last Synced: 2024-12-17T03:35:58.493Z (about 1 month ago)
- Topics: php, phpunit
- Language: PHP
- Homepage: https://packagist.org/packages/natanael-aguiar/secure-password-generator
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
# Secure Password Generator PHP Package
This PHP package allows you to generate secure passwords with configurable options, including uppercase letters, lowercase letters, numbers and special characters.
## InstallationYou can install this package using Composer. Run the following command in the terminal:
```bash
composer require natanael-oliveira/secure-password-generator
```## Use
```php
allowLowercase(true);
$generator->allowUppercase(true);
$generator->allowNumbers(true);
$generator->allowSpecialCharacters(true);// Generate a secure password of length 8
try {
$password = $generator->generatePassword(8);
echo($password);
} catch (Exception $e) {
echo($e);
}
```## Documentation
### `SecurePasswordGenerator` (Main Class)
#### Methods
- `allowLowercase(bool $allow): void` - Enables or disables lowercase letters in the password.
- `allowUppercase(bool $allow): void` - Enables or disables uppercase letters in the password.
- `allowNumbers(bool $allow): void` - Enables or disables numbers in the password.
- `allowSpecialCharacters(bool $allow): void` - Enables or disables special characters in the password.
- `generatePassword(int $length = 12): string` - Generates a secure password with the specified length.## Contribution
Contributions are welcome! Please open an issue or send a pull request if you want to contribute.