Node.js/crypto:修订间差异
来自康健生活
| 第158行: | 第158行: | ||
let encrypted = cipher.update(data, 'utf8', 'hex'); | let encrypted = cipher.update(data, 'utf8', 'hex'); | ||
encrypted += cipher.final('hex'); | encrypted += cipher.final('hex'); | ||
console.log(encrypted);</syntaxhighlight>|{{consoleout|<pre> | console.log(encrypted); | ||
// encrypted = Buffer.concat([encrypted, encrypted.final()]); | |||
// encrypted.toString();</syntaxhighlight>|{{consoleout|<pre> | |||
c5543cd5004e5491ed7cfbeaa3a3d3e2 | c5543cd5004e5491ed7cfbeaa3a3d3e2 | ||
</pre>}}}} | </pre>}}}} | ||