Files

22 lines
386 B
JavaScript
Raw Permalink Normal View History

2026-05-13 19:27:59 -04:00
const argon2 = require('argon2');
async function HashPassword(password) {
try {
return await argon2.hash(password);
} catch(err) {
throw err;
}
}
async function TestPassword(password, hash) {
try {
return await argon2.verify(hash, password);
} catch(err) {
throw err;
}
}
module.exports = {
HashPassword,
TestPassword
}