lib/WebHook.js
function(hmac, bodyData) {
    if (arguments.length < 2) {
      throw paramError;
    }
    var calculatedHmac = crypto.createHmac('sha256', this.token).update(bodyData, 'utf8').digest('base64');
    return hmac === calculatedHmac;
  }
function(hmac, bodyData) {
    if (arguments.length < 2) {
      throw paramError;
    }
    var calculatedHmac = crypto.createHmac('sha256', this.token).update(bodyData, 'utf8').digest('base64');
    return hmac === calculatedHmac;
  }
function ( hmac , bodyData ) { if ( arguments . length < 2 ) { throw paramError ; } var calculatedHmac = crypto . createHmac ( 'sha256' , this . token ) . update ( bodyData , 'utf8' ) . digest ( 'base64' ) ; return hmac === calculatedHmac ; }
验证 Hmac
@param {string} hmac
@param {string} bodyData 响应体数据
@return {boolean}
验证 Hmac