npm.io
0.1.1 • Published 7 years ago

bcrypt-hashpass

Licence
MIT
Version
0.1.1
Deps
1
Size
3 kB
Vulns
1
Weekly
0

bcrypt-hashpass

Simple password hashing and comparing functions.

Usage

ENV

process.env.SALT_ROUNDS: number # 1, 2, 3, any number
rocess.env.PASS_SALT: string # generated salt. This can be ignore for automaticaly generated.
hash pass
import { hashPass, comparePassword } from 'bcrypt-hashpass';
const hashed = hashPass('mysecurepass');
compare password
import { hashPass, comparePassword } from 'bcrypt-hashpass';
const correct = comparePassword('mysecurepass', 'HashedPasswordXXX');