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("$");