【发布时间】:2017-12-18 06:31:42
【问题描述】:
我正在学习Node js,我不知道如何使用Cryptography 库(SHA-1?)。我如何在Node js 中使用SHA-1。这是伪代码:
// Use a Base64-encoder that don't introduce line-breaks,
// or trim the output signature afterwards.
string signature = Base64.encode(SHA1.digest(stringToSign));
【问题讨论】:
-
这可能对你有帮助.. gist.github.com/thinkphp/5110833
-
为了完整起见,请注意,出于加密目的,SHA-1 不应再被视为安全。使用其他哈希函数,例如 SHA-2 系列。
标签: node.js cryptography sha1