password-genie

1.0.3 • Public • Published

Password Genie

Module designed for easily creating and checking sha256 hashed passwords.

Example

The following example shows how you can check a password:

var genie = require('password-genie');

var passwordToCheck = 'MYPASSWORD';
var databaseHash = '655bdbd8f1331c67c11609973479117951fb56e7c86b69c30048fda8241c92fb';
var databaseSalt = '49f38160cb3e9708';

if(genie.checkPassword(passwordToCheck, databaseHash, databaseSalt)){
    console.log('Password matched.');
}else{
    console.log('Password did not match');
}

The following example shows you how to hash a password:

var genie = require('password-genie');

var passwordToHash = 'MYPASSWORD';

var hashedPassword = genie.hashPassword(passwordToHash)

console.log(hashedPassword.hash); //655bdbd8f1331c67c11609973479117951fb56e7c86b69c30048fda8241c92fb
console.log(hashedPassword.salt); //49f38160cb3e9708

Built With

  • crypto-js

Authors

  • Sam Munroe

License

This project is licensed under the MIT License

Readme

Keywords

none

Package Sidebar

Install

npm i password-genie

Weekly Downloads

0

Version

1.0.3

License

MIT

Last publish

Collaborators

  • munroe7