This commit is contained in:
2024-01-23 17:07:19 -05:00
parent 4aea6a8e4c
commit 173277cc8b
21 changed files with 5312 additions and 70 deletions

View File

@ -23,23 +23,18 @@ bcrypt.hash(myPlaintextPassword, saltRounds, function(err, hash) {
*/
//hash for pass or token lol doesnt matter
async function hashPassword(password) {
async function hash(password) {
return await bcrypt.hash(password, saltRounds);
}
async function hashAPIKey(apikey) {
return await bcrypt.hash(apikey, saltRounds);
}
//can be used to compare password or token
async function comparePassword(password, hash) {
async function compareHash(password, hash) {
return await bcrypt.compare(password, hash);
}
module.exports = {
hashPassword,
hashAPIKey,
comparePassword
};
hash,
compareHash
};