package
Provide more secure encryption using more than one library and over an algorithm 🤓 ..
npm install password-cryptGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
A Promise-based library build on top of bcrypt/argon2 module with some logic touch to help you hash passwords.
# npm .
$ npm install password-crypt
# yarn ..
$ yarn add password-cryptThis is a very basic example of how to use.
// const { PasswordCrypt } = require("password-crypt");
import { PasswordCrypt } from "password-crypt";
// PasswordCrypt instance
// Note: you can pass an config object
const pCrypt = new PasswordCrypt();
// default config object
// {
// secret: 'my-secret',
// algorithm: 'sha512',
// saltSize: 10,
// withArgon: false
// }
// helpers
const hash = (pwd: string) => pCrypt.hash(pwd);
const compare = (pwd: string, hash: string) => pCrypt.compare(pwd, hash);
You can play around with p-crypt@v2.x on this sandbox codesandbox.io/password-crypt.