Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
bcrypt-password-hash
Advanced tools
Readme
hash password with bcrypt
Generation and validation of passwords using bcrypt hashes. Uses same api as pbkdf2-password-hash.
Requires node >= v8.0.0
Generate new password hash
const passwordHash = require('bcrypt-password-hash')
// generates random salt
passwordHash.hash('password')
.then((hash) => {
//> hash === 'bcrypt$2b$10$Y6MKD5ZI5gtkvBdYyqwr1.CrHA66ppM/9YNDvacUuqWZSVduKQcIq'
})
Generate password hash with different options
passwordHash.hash('password', {saltRounds: 14})
.then((hash) => {
//> hash === 'bcrypt$2b$14$9zjobUQJ9LVswQrQJ7leKe6NnJKMc3ZouykkhZZ6uFa9ARMZVSUgy'
})
Validate password hash
const hash = 'bcrypt$2b$14$9zjobUQJ9LVswQrQJ7leKe6NnJKMc3ZouykkhZZ6uFa9ARMZVSUgy'
passwordHash.compare('password', hash)
.then((isValid) => {
//> isValid === true
})
hash(password, [salt], [opts])
Generate a new password hash for password using bcrypt.
Parameters
parameter | type | description |
---|---|---|
password | String | |
[salt] | String | optional: salt |
[opts.saltRound=10] | Number | optional: number of iterations |
Returns Promise
, hashed password in bcrypt$<version>$<saltRound>$<salt><hash>
notation.
compare(password, passwordHash)
validate password against passwordHash
Parameters
parameter | type | description |
---|---|---|
password | String | plain-text password |
passwordHash | String | hashed password |
Returns Promise
, true if hash matches password
Requires nodejs >= v8.0.0
$ npm install --save bcrypt-password-hash
$ npm test
UNLICENSE https://unlicense.org
FAQs
hash passwords with bcrypt
The npm package bcrypt-password-hash receives a total of 2 weekly downloads. As such, bcrypt-password-hash popularity was classified as not popular.
We found that bcrypt-password-hash demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.