Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
@adonisjs/hash
Advanced tools
Module to hash values with support for PHC string format
This module is used by AdonisJs to hash the user password with first class support for upgrading logic. A big thanks to the author of uphash, who inspired me to use PHC string format. I would have used uphash directly, but the user facing API is different from what I desire.
Install the package from npm registry as follows:
npm i @adonisjs/hash
# yarn
yarn add @adonisjs/hash
and then use it as follows:
import { Hash } from '@adonisjs/hash/build/standalone'
const hash = new Hash({}, config)
const hashedValue = await hash.hash('password')
await hash.verify(hashedValue)
await hash.needsRehash(hashedValue) // false
The @adonisjs/core
module includes this module by default. However, here's how you can set it up manually.
const providers = [
'@adonisjs/hash'
]
And then also register the typings file inside tsconfig.json
file.
{
"files": ["./node_modules/@adonisjs/hash/build/adonis-typings/hash.d.ts"]
}
And use it as follows:
import Hash from '@ioc:Adonis/Core/Hash'
await Hash.hash('password')
You can switch drivers using the use
method.
await Hash.use('bcrypt').hash('password')
Following are the autogenerated files via Typedoc
FAQs
Framework agnostic Password hashing package with support for PHC string format
The npm package @adonisjs/hash receives a total of 21,127 weekly downloads. As such, @adonisjs/hash popularity was classified as popular.
We found that @adonisjs/hash demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.