From 35fd81e1b2fb8c9fafc32b78aa4a9de75e18fd20 Mon Sep 17 00:00:00 2001 From: rainbow napkin Date: Mon, 3 Nov 2025 19:11:31 -0500 Subject: [PATCH] Improved JSDoc for IP Hash Comparison function. --- src/utils/hashUtils.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/utils/hashUtils.js b/src/utils/hashUtils.js index a428066..47352fb 100644 --- a/src/utils/hashUtils.js +++ b/src/utils/hashUtils.js @@ -85,6 +85,14 @@ module.exports.hashIP= function(ip, salt){ return `${salt}$${hash}`; } +/** + * Site-wide IP hash comparison function + * + * Allows us to identify new plaintext IP's against saved IP hashes + * @param {String} ip - IP to hash + * @param {String} salt - (optional) string to salt IP with, leave empty to default to a securely generated string encoded in base64 + * @returns {Boolean} Whether or not the IP matched the hash + */ module.exports.compareIPHash = function(ip, hash){ //Split hash by salt delimiter const splitHash = hash.split("$");