我要创建我爱蛋糕
(用钥匙abcdeg签署)
I want to create a hash of "I love cupcakes
" (signed with the key "abcdeg")
我怎么可以创建一个散列,使用Node.js的加密?
How can I create that hash , using Node.js Crypto?
文档加密: http://nodejs.org/api /crypto.html
var crypto = require('crypto')
, text = 'I love cupcakes'
, key = 'abcdeg'
, hash
hash = crypto.createHmac('sha1', key).update(text).digest('hex')