nodejs 使用crypto實現sha256\md5加密


1 var crypto = require('crypto');
2 
3 var hash = crypto.createHash('sha256');// sha256或者md5
4 
5 hash.update('123456');
6 
7 var res = hash.digest('hex');
8 
9 console.log(res);// 8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92

參考地址戳 這兒~


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM