-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1d47f6
commit 5a9522b
Showing
3 changed files
with
30 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,19 @@ | ||
Hash and verify passwords hashed with PHP's built-in password_* functions | ||
|
||
Designed to be future proof for new hashing algorithms. | ||
|
||
Usage: | ||
|
||
var Password = require("node-php-password"); | ||
|
||
var hash = Password.password_hash("password123", "PASSWORD_DEFAULT", { cost: 10 }); | ||
//hash: "$2y$10$8mNOnsos8qo4qHLcd32zrOg7gmyvfZ6/o9.2nsP/u6TRbrANdLREy" | ||
|
||
console.log(Password.password_verify("password123", hash); | ||
//true | ||
|
||
var hash = $1$7576f3a00f6de47b0c72c5baf2d505b0 | ||
console.log(Password.password_needs_rehash(hash, "PASSWORD_DEFAULT"); | ||
//true | ||
|
||
WARNING password_needs_rehash is currently not working |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters