mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-21 20:18:06 +02:00
13 lines
324 B
JavaScript
13 lines
324 B
JavaScript
const md5 = require("md5");
|
|||
const crypto = require("crypto");
|
|||
|
|||
function hashPassword(password) {
|
|||
// VULN: md5 is not suitable for password hashing
|
|||
return md5(password);
|
|||
}
|
|||
|
|||
function hashToken(token) {
|
|||
// VULN: sha1 via crypto.createHash is weak
|
|||
return crypto.createHash("sha1").update(token).digest("hex");
|
|||
}
|