Skip to content

Commit ebf8850

Browse files
authored
Update README.md
1 parent 7846a52 commit ebf8850

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,65 @@ php class for random and secure password generation
55
```
66
composer require tbetool/php-password-generator
77
```
8+
# Usage
9+
### Create object
10+
```
11+
use TBETool\PasswordGenerator;
12+
13+
$passwordGenerator = new PasswordGenerator();
14+
```
15+
You can optionally pass following parameters to constructor
16+
```
17+
use TBETool\PasswordGenerator;
18+
19+
$passwordGenerator = new PasswordGenerator($length, $count, $characters);
20+
```
21+
#### Parameter Details
22+
```
23+
$length (int) : Length of the password to generate, Default: 8
24+
$count (int) : No of passwords to generate, Default: 1
25+
$characters (string): Characters to use while password generation
26+
```
27+
#### Supported Characters
28+
1. lower_case
29+
1. upper_case
30+
1. numbers
31+
1. special_symbols
32+
33+
#### Example with parameter
34+
```
35+
use TBETool\PasswordGenerator;
36+
37+
$passwordGenerator = new PasswordGenerator(16, 5, 'lower_case,numbers,special_symbols');
38+
```
39+
40+
### Generate Password
41+
This will return single password from all passwords generated
42+
```
43+
@return string of password
44+
$password = $passwordGenerator->generate();
45+
```
46+
47+
### Get All Generated Passwords
48+
```
49+
@return array of passwords
50+
$passwords = $passwordGenerator->getPasswords();
51+
```
52+
53+
### Get new password from generated passwords
54+
```
55+
@return string of new password
56+
$password = $passwordGenerator->getPassword();
57+
```
58+
59+
### Get last accessed password
60+
```
61+
@return string of last password retrieved
62+
$password = $passwordGenerator->getLastPassword();
63+
```
64+
65+
# Developer
66+
Anuj Sharma (https://anujsh.gitlab.io)
67+
68+
# Package
69+
TBE (http://thebornengineer.com)

0 commit comments

Comments
 (0)