php-password
v0.1.0
Published
Compatibility with PHP password_* functions on Node.js
Readme
node-php-password
Compatibility helpers for PHP password_* functions on modern Node.js.
Requirements
- Node.js 20+
Installation
npm install php-passwordUsage
const phpPassword = require('php-password');
const password = 'passw0rd';
const hashedPassword = phpPassword.password_hash(password, phpPassword.PASSWORD_DEFAULT, { cost: 10 });
if (phpPassword.password_verify(password, hashedPassword)) {
console.log('Success');
}
const info = phpPassword.password_get_info(hashedPassword);
console.log(info);Supported API
hash/password_hashverify/password_verifyget_info/password_get_infoneeds_rehash/password_needs_rehashpassword_algosPASSWORD_DEFAULTPASSWORD_BCRYPT
Development
npm test
npm run lint