https://github.com/walegbenga/php_password_generator
A php passsword generator class
https://github.com/walegbenga/php_password_generator
password password-generator php php-password-generator strong-password
Last synced: 14 days ago
JSON representation
A php passsword generator class
- Host: GitHub
- URL: https://github.com/walegbenga/php_password_generator
- Owner: walegbenga
- Created: 2020-05-15T15:01:11.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-28T21:18:21.000Z (about 6 years ago)
- Last Synced: 2025-12-14T18:41:06.497Z (6 months ago)
- Topics: password, password-generator, php, php-password-generator, strong-password
- Language: PHP
- Homepage:
- Size: 234 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PHP Password Generator Library Usage
To be able to use this library in your project, follow the steps below
## Requirement(s)
- php 5.5 >=
- Composer (for installing the library)
- Gitbash (for running the composer from the command line)
## Installing the package
To install the package in your project, run this command from the command line interface(cli) using gitbash
`composer require walegbenga/php_password_generator`. This will download the library into your project.
## Using the library
To use the library in your project, require the composer autoload script into your project like this
`require __DIR__ . '/vendor/autoload.php`
You can now use the library to generate the Random password for your users like this
```
$passGen = new \SecurePassword\PasswordGenerator($source, 4, CACHE_DIR);
echo $passGen->generate();
```
## Complete example
```
include __DIR__ . '/vendor/autoload.php';// Generally, this should be the relative path to the **vendor** folder
$passGen = new \SecurePassword\PasswordGenerator($source, 4, CACHE_DIR);
echo $passGen->generate();
```
### Where the library is useful
You can use this library to
- Generate hard to guess passwords for your users
- Use it to generate a temporary passwords for users who forgot there passsword
- Use it to generate a token for users
- Use it to generate Serial Number(sn) for your users and so on and so on
Remember, in programming, your imagination is your limitation
### NB
The above example is just a basic usage of using the library.