📜  nodejs sha512 解密 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:05.259000             🧑  作者: Mango

代码示例1
// generate a hash from string
var crypto = require('crypto'),
    text = 'hello bob',
    key = 'mysecret key'

// create hahs
var hash = crypto.createHmac('sha512', key)
hash.update(text)
var value = hash.digest('hex')

// print result
console.log(value);