start
This commit is contained in:
13
utils/passwdCrypto.js
Normal file
13
utils/passwdCrypto.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import bcrypt from 'bcrypt';
|
||||
|
||||
const SALT_ROUNDS = 10;
|
||||
|
||||
function hash(text) {
|
||||
return bcrypt.hash(text, SALT_ROUNDS);
|
||||
}
|
||||
|
||||
function compare(text, hash) {
|
||||
return bcrypt.compare(text, hash);
|
||||
}
|
||||
|
||||
export default { hash, compare }
|
||||
Reference in New Issue
Block a user