飞书自定义机器人签名-node

function sign() {
    const timestamp = parseInt(new Date().getTime() / 1000 + '') + '';
    const secret = '111111111111111111111';
    const stringify = Buffer.from(`${timestamp}\n${secret}`, 'utf8');
    const sign = crypto.createHmac('SHA256', stringify);
    sign.update(Buffer.alloc(0));
    return sign.digest('base64');
  }

飞书机器人添加

你可能感兴趣的:(node,nodejs)