Skip to content

sanmugam-kathirvel/password-salt-and-hash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

password-salt-and-hash

NPM JavaScript Style Guide

Install

npm install --save password-salt-and-hash

Usage

import saltHash from 'password-salt-and-hash'

// hash password
let hashPassword = saltHash.generateSaltHash('foo');

console.log(hashPassword);

Result:

{
  password: 'k1cB2mwUc9q1Q0HPIiI2/Zg1T6ZMGloukzuPIhAJ2oqs+rqVt5+2UgYYzzbJcC8CnKJ2C9KSHXir+O8+ToWjsQ==',
  salt: '8a40191bc15e99a71707c6308514f0568c20cb951538e1104d'
}

Verify

// check entered password with stored hash
let isPasswordMatch = saltHash.verifySaltHash(hashPassword.salt, hashPassword.password, 'foo');

console.log(isPasswordMatch);

Result:

true

License

MIT ©

About

A straight-forward password hashing module for node.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published