Skip to content

Instantly share code, notes, and snippets.

@No14
No14 / md5.js
Created October 16, 2012 08:12
a javascript md5 generator
// form http://blueimp.github.com/JavaScript-MD5/
var md5 = function (str) {
/*
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
* to work around bugs in some JS interpreters.
*/
function safe_add(x, y) {
var lsw = (x & 0xFFFF) + (y & 0xFFFF),
msw = (x >> 16) + (y >> 16) + (lsw >> 16);