CryptoJS

https://github.com/sytelus/CryptoJS

MD5+base64

<script src="/cryptojslib/rollups/md5.js"></script>
<script src="/cryptojslib/components/enc-base64-min.js"></script>
<script>
    var hash = CryptoJS.MD5("Message");
    alert(hash.toString(CryptoJS.enc.Base64));
</script>

SHA-1

<script src="/cryptojslib/rollups/sha1.js"></script>
<script> 
    alert(CryptoJS.SHA1("123456").toString());
</script>

SHA-256

<script src="/cryptojslib/rollups/sha256.js"></script>
<script>
    var hash = CryptoJS.SHA256("Message");
    alert(hash.toString()); 
</script>

编码解码

<script>
    var wordArray = CryptoJS.enc.Utf8.parse('xxxx');
    var utf8  = CryptoJS.enc.Utf8.stringify(wordArray);
    console.log(utf8);
</script>