in source/rest-api-handler/index.js [152:172]
function validateHash(userID, providedHash, hashKey) {
log.trace("validateHash...");
if (userID && providedHash && hashKey) {
var hashValue = `${userID}+${hashKey}`;
var hash = crypto.createHash('sha256')
.update(hashValue)
.digest('hex');
if (providedHash == hash) {
log.debug("Valid Hash!");
return true;
} else {
log.warn("Invalid Hash!");
return false;
}
} else {
return false;
}
}