Last active
September 10, 2020 09:06
-
-
Save robozavri/03479f1980b32a85ebc4eb9d828ecdfc to your computer and use it in GitHub Desktop.
#node.js bcrypt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { hashSync, compareSync } from 'bcrypt-nodejs'; | |
export function generateHash(data: any) { | |
return hashSync(data, undefined); | |
} | |
export function compareHash(data: any, hash: any) { | |
return compareSync(data, hash); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment