2.0.0 • Published 5 years ago

@frontendmonster/password v2.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

password

useful encryption and jwt utils

Usage

import { hash, compare, uid, decode, sign, verify } from '@frontendmonster/password';

const hashedPassword = await hash(password, salt); // hash password with specific salt
const await compare(userPassword, hasedPassword); // compare hashed passwords
const token = uid(16); // crate 16-len uid
const jwt = sign(payload, secret, option); // sign json web token
const isValid = verify(jwt, tokn); // verify json web token
const payload = decode(jwt); // decode json web token