This commit is contained in:
newtbot
2024-01-20 01:22:19 +08:00
parent 1ed59aba97
commit 2ecb69c828
8 changed files with 59 additions and 35 deletions

View File

@ -29,9 +29,14 @@ async function hashAPIKey(apikey) {
return await bcrypt.hash(apikey, saltRounds);
}
async function comparePassword(password, hash) {
return await bcrypt.compare(password, hash);
}
module.exports = {
hashPassword,
hashAPIKey,
comparePassword
};