Skip to content

Instantly share code, notes, and snippets.

@aleandroid
Last active May 4, 2021 23:33
Show Gist options
  • Save aleandroid/ca7b7fd58a4a05751f5608107f87a7f0 to your computer and use it in GitHub Desktop.
Save aleandroid/ca7b7fd58a4a05751f5608107f87a7f0 to your computer and use it in GitHub Desktop.
PajHome MD5
!function(r){var t=0,n="";function e(r){return h(o(r))}function o(r){return i(g(u(r),8*r.length))}function a(r,t){var n=u(r);n.length>16&&(n=g(n,8*r.length));for(var e=Array(16),o=Array(16),a=0;a<16;a++)e[a]=909522486^n[a],o[a]=1549556828^n[a];var h=g(e.concat(u(t)),512+8*t.length);return i(g(o.concat(h),640))}function h(r){for(var n,e=t?"0123456789ABCDEF":"0123456789abcdef",o="",a=0;a<r.length;a++)n=r.charCodeAt(a),o+=e.charAt(n>>>4&15)+e.charAt(15&n);return o}function c(r){for(var t="",e=r.length,o=0;o<e;o+=3)for(var a=r.charCodeAt(o)<<16|(o+1<e?r.charCodeAt(o+1)<<8:0)|(o+2<e?r.charCodeAt(o+2):0),h=0;h<4;h++)8*o+6*h>8*r.length?t+=n:t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(a>>>6*(3-h)&63);return t}function f(r,t){var n,e,o,a,h,c=t.length,f=Array(Math.ceil(r.length/2));for(n=0;n<f.length;n++)f[n]=r.charCodeAt(2*n)<<8|r.charCodeAt(2*n+1);var u=Math.ceil(8*r.length/(Math.log(t.length)/Math.log(2))),i=Array(u);for(e=0;e<u;e++){for(h=Array(),a=0,n=0;n<f.length;n++)a=(a<<16)+f[n],a-=(o=Math.floor(a/c))*c,(h.length>0||o>0)&&(h[h.length]=o);i[e]=a,f=h}var g="";for(n=i.length-1;n>=0;n--)g+=t.charAt(i[n]);return g}function u(r){for(var t=Array(r.length>>2),n=0;n<t.length;n++)t[n]=0;for(n=0;n<8*r.length;n+=8)t[n>>5]|=(255&r.charCodeAt(n/8))<<n%32;return t}function i(r){for(var t="",n=0;n<32*r.length;n+=8)t+=String.fromCharCode(r[n>>5]>>>n%32&255);return t}function g(r,t){r[t>>5]|=128<<t%32,r[14+(t+64>>>9<<4)]=t;for(var n=1732584193,e=-271733879,o=-1732584194,a=271733878,h=0;h<r.length;h+=16){var c=n,f=e,u=o,i=a;e=m(e=m(e=m(e=m(e=A(e=A(e=A(e=A(e=C(e=C(e=C(e=C(e=l(e=l(e=l(e=l(e,o=l(o,a=l(a,n=l(n,e,o,a,r[h+0],7,-680876936),e,o,r[h+1],12,-389564586),n,e,r[h+2],17,606105819),a,n,r[h+3],22,-1044525330),o=l(o,a=l(a,n=l(n,e,o,a,r[h+4],7,-176418897),e,o,r[h+5],12,1200080426),n,e,r[h+6],17,-1473231341),a,n,r[h+7],22,-45705983),o=l(o,a=l(a,n=l(n,e,o,a,r[h+8],7,1770035416),e,o,r[h+9],12,-1958414417),n,e,r[h+10],17,-42063),a,n,r[h+11],22,-1990404162),o=l(o,a=l(a,n=l(n,e,o,a,r[h+12],7,1804603682),e,o,r[h+13],12,-40341101),n,e,r[h+14],17,-1502002290),a,n,r[h+15],22,1236535329),o=C(o,a=C(a,n=C(n,e,o,a,r[h+1],5,-165796510),e,o,r[h+6],9,-1069501632),n,e,r[h+11],14,643717713),a,n,r[h+0],20,-373897302),o=C(o,a=C(a,n=C(n,e,o,a,r[h+5],5,-701558691),e,o,r[h+10],9,38016083),n,e,r[h+15],14,-660478335),a,n,r[h+4],20,-405537848),o=C(o,a=C(a,n=C(n,e,o,a,r[h+9],5,568446438),e,o,r[h+14],9,-1019803690),n,e,r[h+3],14,-187363961),a,n,r[h+8],20,1163531501),o=C(o,a=C(a,n=C(n,e,o,a,r[h+13],5,-1444681467),e,o,r[h+2],9,-51403784),n,e,r[h+7],14,1735328473),a,n,r[h+12],20,-1926607734),o=A(o,a=A(a,n=A(n,e,o,a,r[h+5],4,-378558),e,o,r[h+8],11,-2022574463),n,e,r[h+11],16,1839030562),a,n,r[h+14],23,-35309556),o=A(o,a=A(a,n=A(n,e,o,a,r[h+1],4,-1530992060),e,o,r[h+4],11,1272893353),n,e,r[h+7],16,-155497632),a,n,r[h+10],23,-1094730640),o=A(o,a=A(a,n=A(n,e,o,a,r[h+13],4,681279174),e,o,r[h+0],11,-358537222),n,e,r[h+3],16,-722521979),a,n,r[h+6],23,76029189),o=A(o,a=A(a,n=A(n,e,o,a,r[h+9],4,-640364487),e,o,r[h+12],11,-421815835),n,e,r[h+15],16,530742520),a,n,r[h+2],23,-995338651),o=m(o,a=m(a,n=m(n,e,o,a,r[h+0],6,-198630844),e,o,r[h+7],10,1126891415),n,e,r[h+14],15,-1416354905),a,n,r[h+5],21,-57434055),o=m(o,a=m(a,n=m(n,e,o,a,r[h+12],6,1700485571),e,o,r[h+3],10,-1894986606),n,e,r[h+10],15,-1051523),a,n,r[h+1],21,-2054922799),o=m(o,a=m(a,n=m(n,e,o,a,r[h+8],6,1873313359),e,o,r[h+15],10,-30611744),n,e,r[h+6],15,-1560198380),a,n,r[h+13],21,1309151649),o=m(o,a=m(a,n=m(n,e,o,a,r[h+4],6,-145523070),e,o,r[h+11],10,-1120210379),n,e,r[h+2],15,718787259),a,n,r[h+9],21,-343485551),n=v(n,c),e=v(e,f),o=v(o,u),a=v(a,i)}return Array(n,e,o,a)}function d(r,t,n,e,o,a){return v((h=v(v(t,r),v(e,a)))<<(c=o)|h>>>32-c,n);var h,c}function l(r,t,n,e,o,a,h){return d(t&n|~t&e,r,t,o,a,h)}function C(r,t,n,e,o,a,h){return d(t&e|n&~e,r,t,o,a,h)}function A(r,t,n,e,o,a,h){return d(t^n^e,r,t,o,a,h)}function m(r,t,n,e,o,a,h){return d(n^(t|~e),r,t,o,a,h)}function v(r,t){var n=(65535&r)+(65535&t);return(r>>16)+(t>>16)+(n>>16)<<16|65535&n}r.hex_md5=e,r.b64_md5=function(r){return c(o(r))},r.any_md5=function(r,t){return f(o(r),t)},r.hex_hmac_md5=function(r,t){return h(a(r,t))},r.b64_hmac_md5=function(r,t){return c(a(r,t))},r.any_hmac_md5=function(r,t,n){return f(a(r,t),n)},r.rstr_md5=o,r.rstr_hmac_md5=a,r.rstr2hex=h,r.rstr2b64=c,r.rstr2any=f,r.rstr2b64=c,r.md5_vm_test=function(){return"900150983cd24fb0d6963f7d28e17f72"==e("abc").toLowerCase()},r.str2rstr_utf8=function(r){for(var t,n,e="",o=-1;++o<r.length;)t=r.charCodeAt(o),n=o+1<r.length?r.charCodeAt(o+1):0,55296<=t&&t<=56319&&56320<=n&&n<=57343&&(t=65536+((1023&t)<<10)+(1023&n),o++),t<=127?e+=String.fromCharCode(t):t<=2047?e+=String.fromCharCode(192|t>>>6&31,128|63&t):t<=65535?e+=String.fromCharCode(224|t>>>12&15,128|t>>>6&63,128|63&t):t<=2097151&&(e+=String.fromCharCode(240|t>>>18&7,128|t>>>12&63,128|t>>>6&63,128|63&t));return e},r.str2rstr_utf16le=function(r){for(var t="",n=0;n<r.length;n++)t+=String.fromCharCode(255&r.charCodeAt(n),r.charCodeAt(n)>>>8&255);return t},r.str2rstr_utf16be=function(r){for(var t="",n=0;n<r.length;n++)t+=String.fromCharCode(r.charCodeAt(n)>>>8&255,255&r.charCodeAt(n));return t}}(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment