This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const crypto = require('crypto'); | |
const hmac = crypto.createHmac('SHA256', 'my-webhook-secret'); | |
hmac.update('{ ... }'); // request body | |
const correctHash = hmac.digest().toString('hex'); | |
const receivedHash = '...'; // e.g. req.get('x-impala-signature'); | |
/* | |
* It's important to perform a constant time equality comparison of the |