1.0.0 • Published 4 years ago
fastify-argon2 v1.0.0
fastify-argon2
Supports Fastify versions 3.x
Install
npm i --save fastify-argon2Usage
Require fastify-argon2 and register. This will decorate your fastify instance with the following methods: hash, verify, and needsRehash. It will also register request.argon2Hash, request.argon2Verify, and request.argon2NeedsRehash.
const fastify = require('fastify')()
fastify.register(require('fastify-argon2'))
fastify.argon2.hash('password')
.then(hash => fastify.argon2.verify(hash, 'password'))
.then(isMatch => console.log(isMatch ? 'Matched" : 'Not matched'))
.catch(err => console.error(err.message))
fastify.listen(3000)Acknowledgements
License
Licensed under MIT.
1.0.0
4 years ago