引入
const crypto = require('crypto');
使用
const hash = crypto.createHash('md5');
hash.update('123456');
res.end(hash.digest('hex'));

本文介绍了如何在Node.js中使用`crypto`模块创建一个MD5哈希函数,通过实例展示了如何计算并以十六进制格式输出字符串123456的哈希值。
引入
const crypto = require('crypto');
使用
const hash = crypto.createHash('md5');
hash.update('123456');
res.end(hash.digest('hex'));

1212

被折叠的 条评论
为什么被折叠?