【发布时间】:2020-06-01 19:46:34
【问题描述】:
我在我的 nestjs 应用程序中使用了一个 API。我需要提供哈希作为有效负载的一部分。
在 API 文档中,我应该这样做
使用 hash_hmac 函数创建哈希
computed_hash = hash_hmac("sha1", somecombinedstring, privatekey)
所以我在nodejs中使用了cryptojs
var hash = crypto.createHmac('sha1', combinestring, privatekey);
当我将哈希传递给端点时,我得到 Invalid Hash
如何创建有效的哈希
谢谢
【问题讨论】: