📅  最后修改于: 2022-03-11 15:03:15.507000             🧑  作者: Mango
const FB_APP_SECRET = 'your facebook app secret';
// requires
const crypto = require('crypto');
const verifyXHubSignature = req => {
const digest = crypto
.createHmac('sha1', FB_APP_SECRET)
.update(req.rawBody)
.digest('hex');
return req.headers['x-hub-signature'] === `sha1=${digest}`;
};