https://github.com/sytelus/CryptoJS
<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>
<script src="/cryptojslib/rollups/sha1.js"></script>
<script>
alert(CryptoJS.SHA1("123456").toString());
</script>
<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>