🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

fastify-bcrypt

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastify-bcrypt

A Bcrypt hash generator & checker

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
1.3K
-24.06%
Maintainers
1
Weekly downloads
 
Created
Source

fastify-bcrypt

A Bcrypt hash generator & checker

https://it.wikipedia.org/wiki/Bcrypt

Node.js CI

Install

$ npm i --save fastify-bcrypt

Usage

fastify.register(require('fastify-bcrypt'), {
  saltWorkFactor: 12
})

fastify.bcrypt.hash('password')
  .then(hash => fastify.bcrypt.compare('password', hash))
  .then(match => console.log(match ? 'Matched!' : 'Not matched!'))
  .catch(err => console.error(err.message))

// Matched!

Options

NameDescription
saltWorkFactorThe salt work factor for the bcrypt algorithm. The default value is 10.

Methods

NameDescription
hash (claim) [async]Generate an hash of given claim.
compare (claim, hash) [async]Compare an hashed claim with hash. NOTE: they're not reversible!

Request

NameDescription
bcryptHash (claim) [async]See hash.
bcryptCompare (claim, hash) [async]See compare.

Test

$ npm test

Acknowledgements

This project is kindly sponsored by:

Beliven

License

Licensed under MIT

Keywords

fastify

FAQs

Package last updated on 13 Oct 2022

Did you know?

Socket

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