I've read that doing a string comparison is not the preferred way to determine if hmac signatures match. (Go to Step 5) So, in Node, given something like this
const hmac = crypto.createHmac("sha256", signingSecret).update(buf, encoding);
const computed = `${version}=${hmac.digest('hex')}`;
if(computed !== req.header("signature")){
throw
}
If not for string comparison, what is the preferred way of doing this line: computed !== req.header("signature")
?