来源于github,本人仅仅封装成layui组件,原项目地址
https://github.com/h2non/jshashes
layui.config({
base: './extend/' //配置 layui 第三方扩展组件存放的基础目录
}).extend({
hashes: "hashes",
}).use(["hashes"], function () {
var hashes = layui.hashes;
console.log('md5:'+hashes.md5('123456'));
console.log('sha1:'+hashes.sha1('123456'));
console.log('sha256:'+hashes.sha256('123456'));
console.log('sha512:'+hashes.sha512('123456'));
console.log('rmd160:'+hashes.rmd160('123456'));
console.log('crc32:'+hashes.crc32('123456'));
console.log('Base64Encode:'+hashes.Base64Encode('123456'));
console.log('Base64Decode:'+hashes.Base64Decode(hashes.Base64Encode('123456')));
});