node加签给钉钉提醒

const timestamp = new Date().getTime()
const secret="你的秘钥"
const stringToSign = timestamp + "n" + secret
const sign = crypto.createHmac('sha256', secret).update(stringToSign).digest("base64")
// 最终得到的签名sign
const sign_urlencode = encodeURIComponent(sign)

你可能感兴趣的:(node.js,crypto,钉钉)