我正在尝试获得与在http://jssha.sourceforge.net/获得的相同结果
在哪里
我有问题中的“测试”一词:
var word = 'testing';
var hex = toHex(word); // '740065007300740069006e006700';
在 jssha 上,当使用变量input type
值和 SHA-512 选择 HEX 时,hex
我得到以下结果:
6e42b2c2a6351036b78384212774135d99d849da3066264983e495b5f74dc922e3d361b8ea9c8527169757233ed0bd4e56b2c42aab0a21bbcca67219dc53b472
尽管我无法使用nodejs crypto module获得相同的结果。
require('crypto').createHash('sha512').update(hex).digest('hex')
输出:
9ad6d9053c6c420fe61ec2fffd094e3a325bc71708e18232fd764a5eb30315e38464e620ef0b55b92fbf6c809838652a72d9412b0398b28d61ca432962451de2
所以我想知道如何使用加密模块获得与jssha相同的结果?
谢谢