Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
const crypto = require('crypto');
const hmac = crypto.createHmac('sha1', process.env.SECRET_KEY);
let hubHeader = event.headers['X-Hub-Signature'];
let secretCompare = 'sha1=' + hmac.digest('hex');
console.log(secretCompare + ' == ' + hubHeader, secretCompare == hubHeader);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment