This commit is contained in:
Tben
2023-08-12 16:46:00 +01:00
parent da559d13ff
commit cb195616b3
27 changed files with 727 additions and 564 deletions
+13
View File
@@ -0,0 +1,13 @@
const { createHmac } = require("crypto");
/**
* # Hash password Function
* @param {string} password
* @returns {string}
*/
module.exports = function hashPassword(password) {
const hmac = createHmac("sha512", process.env.ENCRYPTION_PASSWORD);
hmac.update(password);
let hashed = hmac.digest("base64");
return hashed;
};