2020-01-23 11:15:58 +01:00
|
|
|
import bcrypt from "bcryptjs";
|
|
|
|
|
|
|
|
function hash(password) {
|
|
|
|
return bcrypt.hashSync(password, 10);
|
|
|
|
}
|
|
|
|
|
|
|
|
function verify(password, hash) {
|
|
|
|
return bcrypt.compareSync(password, hash);
|
|
|
|
}
|
|
|
|
|
2019-07-15 08:12:52 +02:00
|
|
|
|
|
|
|
export default {
|
|
|
|
hash, verify
|
|
|
|
};
|