Socket
Socket
Sign inDemoInstall

pass-hasher

Package Overview
Dependencies
107
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pass-hasher

Generate hashing string and salt and pepper for your user username and password


Version published
Weekly downloads
4
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Install

pass-hasher installation is possible from npm

npm install pass-hasher --save --save-exat

Introduction

The pass-hasher is a little and simple package which used the bcrypt package for create salt and hashing the password. The pass-hasher in another side add the random generated pepper on user password for to be more secured.

How to use

pass-hasher is have three simple methods.

const passHasher = require('pass-hasher')

// for beggining is possible to set how many salt rounds to have (by default = 14)

let securityStuff = passHasher.generateKeys('username', 'password')
// passHasher.generateKeys is return the object with hash and salt parameters
// {
// salt: '$2a$14$YW9hTocIftJFw.P1Bshlee',
// hash: '$2a$14$YW9hTocIftJFw.P1BshleeVDS8Rzjk6fGXMSOFXIyUKknIt/y0DyO'
// }


let salt = 'some salt from password db' // get salt from password db
// return hashing string for current password
let hash = passHasher.checkPassword('username', 'password', salt)

let hash = 'some hash from password db' // get hash from password db
// return boolean variable do can user authenticate with that password and username
let isAuthenticated = passHasher.checkPassword('username', 'password', salt, hash)

Keywords

FAQs

Last updated on 29 Apr 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc