{"ScriptPreparationCode":"var str = \u0060\r\nfunction md5cycle(x, k) {\r\nvar a = x[0], b = x[1], c = x[2], d = x[3];\r\n\r\na = ff(a, b, c, d, k[0], 7, -680876936);\r\nd = ff(d, a, b, c, k[1], 12, -389564586);\r\nc = ff(c, d, a, b, k[2], 17, 606105819);\r\nb = ff(b, c, d, a, k[3], 22, -1044525330);\r\na = ff(a, b, c, d, k[4], 7, -176418897);\r\nd = ff(d, a, b, c, k[5], 12, 1200080426);\r\nc = ff(c, d, a, b, k[6], 17, -1473231341);\r\nb = ff(b, c, d, a, k[7], 22, -45705983);\r\na = ff(a, b, c, d, k[8], 7, 1770035416);\r\nd = ff(d, a, b, c, k[9], 12, -1958414417);\r\nc = ff(c, d, a, b, k[10], 17, -42063);\r\nb = ff(b, c, d, a, k[11], 22, -1990404162);\r\na = ff(a, b, c, d, k[12], 7, 1804603682);\r\nd = ff(d, a, b, c, k[13], 12, -40341101);\r\nc = ff(c, d, a, b, k[14], 17, -1502002290);\r\nb = ff(b, c, d, a, k[15], 22, 1236535329);\r\n\r\na = gg(a, b, c, d, k[1], 5, -165796510);\r\nd = gg(d, a, b, c, k[6], 9, -1069501632);\r\nc = gg(c, d, a, b, k[11], 14, 643717713);\r\nb = gg(b, c, d, a, k[0], 20, -373897302);\r\na = gg(a, b, c, d, k[5], 5, -701558691);\r\nd = gg(d, a, b, c, k[10], 9, 38016083);\r\nc = gg(c, d, a, b, k[15], 14, -660478335);\r\nb = gg(b, c, d, a, k[4], 20, -405537848);\r\na = gg(a, b, c, d, k[9], 5, 568446438);\r\nd = gg(d, a, b, c, k[14], 9, -1019803690);\r\nc = gg(c, d, a, b, k[3], 14, -187363961);\r\nb = gg(b, c, d, a, k[8], 20, 1163531501);\r\na = gg(a, b, c, d, k[13], 5, -1444681467);\r\nd = gg(d, a, b, c, k[2], 9, -51403784);\r\nc = gg(c, d, a, b, k[7], 14, 1735328473);\r\nb = gg(b, c, d, a, k[12], 20, -1926607734);\r\n\r\na = hh(a, b, c, d, k[5], 4, -378558);\r\nd = hh(d, a, b, c, k[8], 11, -2022574463);\r\nc = hh(c, d, a, b, k[11], 16, 1839030562);\r\nb = hh(b, c, d, a, k[14], 23, -35309556);\r\na = hh(a, b, c, d, k[1], 4, -1530992060);\r\nd = hh(d, a, b, c, k[4], 11, 1272893353);\r\nc = hh(c, d, a, b, k[7], 16, -155497632);\r\nb = hh(b, c, d, a, k[10], 23, -1094730640);\r\na = hh(a, b, c, d, k[13], 4, 681279174);\r\nd = hh(d, a, b, c, k[0], 11, -358537222);\r\nc = hh(c, d, a, b, k[3], 16, -722521979);\r\nb = hh(b, c, d, a, k[6], 23, 76029189);\r\na = hh(a, b, c, d, k[9], 4, -640364487);\r\nd = hh(d, a, b, c, k[12], 11, -421815835);\r\nc = hh(c, d, a, b, k[15], 16, 530742520);\r\nb = hh(b, c, d, a, k[2], 23, -995338651);\r\n\r\na = ii(a, b, c, d, k[0], 6, -198630844);\r\nd = ii(d, a, b, c, k[7], 10, 1126891415);\r\nc = ii(c, d, a, b, k[14], 15, -1416354905);\r\nb = ii(b, c, d, a, k[5], 21, -57434055);\r\na = ii(a, b, c, d, k[12], 6, 1700485571);\r\nd = ii(d, a, b, c, k[3], 10, -1894986606);\r\nc = ii(c, d, a, b, k[10], 15, -1051523);\r\nb = ii(b, c, d, a, k[1], 21, -2054922799);\r\na = ii(a, b, c, d, k[8], 6, 1873313359);\r\nd = ii(d, a, b, c, k[15], 10, -30611744);\r\nc = ii(c, d, a, b, k[6], 15, -1560198380);\r\nb = ii(b, c, d, a, k[13], 21, 1309151649);\r\na = ii(a, b, c, d, k[4], 6, -145523070);\r\nd = ii(d, a, b, c, k[11], 10, -1120210379);\r\nc = ii(c, d, a, b, k[2], 15, 718787259);\r\nb = ii(b, c, d, a, k[9], 21, -343485551);\r\n\r\nx[0] = add32(a, x[0]);\r\nx[1] = add32(b, x[1]);\r\nx[2] = add32(c, x[2]);\r\nx[3] = add32(d, x[3]);\r\n\r\n}\r\n\r\nfunction cmn(q, a, b, x, s, t) {\r\na = add32(add32(a, q), add32(x, t));\r\nreturn add32((a \u003C\u003C s) | (a \u003E\u003E\u003E (32 - s)), b);\r\n}\r\n\r\nfunction ff(a, b, c, d, x, s, t) {\r\nreturn cmn((b \u0026 c) | ((~b) \u0026 d), a, b, x, s, t);\r\n}\r\n\r\nfunction gg(a, b, c, d, x, s, t) {\r\nreturn cmn((b \u0026 d) | (c \u0026 (~d)), a, b, x, s, t);\r\n}\r\n\r\nfunction hh(a, b, c, d, x, s, t) {\r\nreturn cmn(b ^ c ^ d, a, b, x, s, t);\r\n}\r\n\r\nfunction ii(a, b, c, d, x, s, t) {\r\nreturn cmn(c ^ (b | (~d)), a, b, x, s, t);\r\n}\r\n\r\nfunction md51(s) {\r\ntxt = \u0027\u0027;\r\nvar n = s.length,\r\nstate = [1732584193, -271733879, -1732584194, 271733878], i;\r\nfor (i=64; i\u003C=s.length; i\u002B=64) {\r\nmd5cycle(state, md5blk(s.substring(i-64, i)));\r\n}\r\ns = s.substring(i-64);\r\nvar tail = [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0];\r\nfor (i=0; i\u003Cs.length; i\u002B\u002B)\r\ntail[i\u003E\u003E2] |= s.charCodeAt(i) \u003C\u003C ((i%4) \u003C\u003C 3);\r\ntail[i\u003E\u003E2] |= 0x80 \u003C\u003C ((i%4) \u003C\u003C 3);\r\nif (i \u003E 55) {\r\nmd5cycle(state, tail);\r\nfor (i=0; i\u003C16; i\u002B\u002B) tail[i] = 0;\r\n}\r\ntail[14] = n*8;\r\nmd5cycle(state, tail);\r\nreturn state;\r\n}\r\n\r\n/* there needs to be support for Unicode here,\r\n * unless we pretend that we can redefine the MD-5\r\n * algorithm for multi-byte characters (perhaps\r\n * by adding every four 16-bit characters and\r\n * shortening the sum to 32 bits). Otherwise\r\n * I suggest performing MD-5 as if every character\r\n * was two bytes--e.g., 0040 0025 = @%--but then\r\n * how will an ordinary MD-5 sum be matched?\r\n * There is no way to standardize text to something\r\n * like UTF-8 before transformation; speed cost is\r\n * utterly prohibitive. The JavaScript standard\r\n * itself needs to look at this: it should start\r\n * providing access to strings as preformed UTF-8\r\n * 8-bit unsigned value arrays.\r\n */\r\nfunction md5blk(s) { /* I figured global was faster. */\r\nvar md5blks = [], i; /* Andy King said do it this way. */\r\nfor (i=0; i\u003C64; i\u002B=4) {\r\nmd5blks[i\u003E\u003E2] = s.charCodeAt(i)\r\n\u002B (s.charCodeAt(i\u002B1) \u003C\u003C 8)\r\n\u002B (s.charCodeAt(i\u002B2) \u003C\u003C 16)\r\n\u002B (s.charCodeAt(i\u002B3) \u003C\u003C 24);\r\n}\r\nreturn md5blks;\r\n}\r\n\r\nvar hex_chr = \u00270123456789abcdef\u0027.split(\u0027\u0027);\r\n\r\nfunction rhex(n)\r\n{\r\nvar s=\u0027\u0027, j=0;\r\nfor(; j\u003C4; j\u002B\u002B)\r\ns \u002B= hex_chr[(n \u003E\u003E (j * 8 \u002B 4)) \u0026 0x0F]\r\n\u002B hex_chr[(n \u003E\u003E (j * 8)) \u0026 0x0F];\r\nreturn s;\r\n}\r\n\r\nfunction hex(x) {\r\nfor (var i=0; i\u003Cx.length; i\u002B\u002B)\r\nx[i] = rhex(x[i]);\r\nreturn x.join(\u0027\u0027);\r\n}\r\n\r\nfunction md5(s) {\r\nreturn hex(md51(s));\r\n}\r\n\r\n/* this function is much faster,\r\nso if possible we use it. Some IEs\r\nare the only ones I know of that\r\nneed the idiotic second function,\r\ngenerated by an if clause. */\r\n\r\nfunction add32(a, b) {\r\nreturn (a \u002B b) \u0026 0xFFFFFFFF;\r\n}\r\n\r\nif (md5(\u0027hello\u0027) != \u00275d41402abc4b2a76b9719d911017c592\u0027) {\r\nfunction add32(x, y) {\r\nvar lsw = (x \u0026 0xFFFF) \u002B (y \u0026 0xFFFF),\r\nmsw = (x \u003E\u003E 16) \u002B (y \u003E\u003E 16) \u002B (lsw \u003E\u003E 16);\r\nreturn (msw \u003C\u003C 16) | (lsw \u0026 0xFFFF);\r\n}\r\n}\r\n\u0060.trim();","TestCases":[{"Name":"js-md5","Code":"md5(str);","IsDeferred":false},{"Name":"CryptoJS","Code":"CryptoJS.MD5(str).toString();","IsDeferred":false},{"Name":"SparkMD5","Code":"SparkMD5.hash(str);","IsDeferred":false},{"Name":"Hash-WASM","Code":"hashwasm.md5(str);","IsDeferred":false},{"Name":"joseph-md5","Code":"joseph_md5(str);","IsDeferred":false}]}