MD5使用方法:
const crypto = require(‘crypto‘);var obj = crypto.createHash(‘md5‘);// 可多次调用 updateobj.update(‘123456‘);obj.update(‘789‘); console.log(obj.digest(‘hex‘));
sha256 使用方法,可将‘md5’ 直接改成 ‘sha256‘ 就可以。
nodejs -- crypto MD5签名
原文地址:https://www.cnblogs.com/gzh529/p/10592186.html