Skip to content

Commit 8c3a06b

Browse files
committed
Tweak examples a bit in README.md
1 parent 3a7da75 commit 8c3a06b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

README.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ Only users with accounts in our application can be authenticated.
1212

1313
## Working with Passwords
1414

15-
### Hashing Passwords
15+
### Hashing and Validating Passwords
1616

1717
Passwords can be hashed using one of the three mechanisms:
1818

1919
1. PHP's built in `password_*` functions. This is default and recommended method
2020
1. Using PBKDF2
2121
1. Using SHA1
2222

23-
Later two are there for compatibility resons only, so you can transition your hashed passwords to PHP's password management system if you have not done that already. Password manager's `needsRehash()` method will always recommend rehashing for PBKDF2 and SHA1 hashed passwords.
23+
Later two are there for compatibility reasons only, so you can transition your hashed passwords to PHP's password management system if you have not done that already. Password manager's `needsRehash()` method will always recommend rehashing for PBKDF2 and SHA1 hashed passwords.
2424

2525
Example:
2626

@@ -41,8 +41,6 @@ Library offers a way to check if password needs to be rehashed, usually after yo
4141
```php
4242
$manager = new PasswordManager('global salt, if needed');
4343

44-
$hash = $manager->hash('easy to remember, hard to guess');
45-
4644
if ($manager->verify($user_provided_password, $hash_from_storage, PasswordManagerInterface::HASHED_WITH_PHP)) {
4745
if ($manager->needsRehash($hash_from_storage, PasswordManagerInterface::HASHED_WITH_PHP)) {
4846
// Update hash in our data storage
@@ -79,7 +77,7 @@ Here's an example where all rules are enforced:
7977
(new PasswordStrengthValidator())->isPasswordValid('BhkXuemYY#WMdU;QQd4QpXpcEjbw2XHP', new PasswordPolicy(32, true, true, true));
8078
```
8179

82-
## Generating Passwords
80+
### Generating Random Passwords
8381

8482
Password strength validator can also be used to prepare new passwords that meed the requirements of provided policies:
8583

0 commit comments

Comments
 (0)