nodejs之crypto加密算法

示例
const crypto = require('crypto');
const hash = crypto.createHash('sha256');

hash.update('some data to hash');
console.log(hash.digest('hex'));
// Prints:
//   6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50

参考:
https://www.cnblogs.com/chyingp/p/nodejs-learning-crypto-theory.html
官方文档

posted @ 2019-01-03 10:52  raindi  阅读(433)  评论(0编辑  收藏  举报