This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues/pull-requests.
bytedo
/
wcui
Archived
1
0
Fork 0
wcui/js/lib/md5/md5.js

1 line
6.4 KiB
JavaScript
Raw Normal View History

2017-03-30 01:40:59 +08:00
!function(t){if("object"==typeof exports)module.exports=t();else if("function"==typeof define&&define.amd)define(t);else{var r;try{r=window}catch(n){r=self}r.SparkMD5=t()}}(function(){"use strict";var t=function(t,r){return t+r&4294967295},r=function(r,n,e,i,f,o){return n=t(t(n,r),t(i,o)),t(n<<f|n>>>32-f,e)},n=function(t,n,e,i,f,o,s){return r(n&e|~n&i,t,n,f,o,s)},e=function(t,n,e,i,f,o,s){return r(n&i|e&~i,t,n,f,o,s)},i=function(t,n,e,i,f,o,s){return r(n^e^i,t,n,f,o,s)},f=function(t,n,e,i,f,o,s){return r(e^(n|~i),t,n,f,o,s)},o=function(r,o){var s=r[0],u=r[1],a=r[2],h=r[3];s=n(s,u,a,h,o[0],7,-680876936),h=n(h,s,u,a,o[1],12,-389564586),a=n(a,h,s,u,o[2],17,606105819),u=n(u,a,h,s,o[3],22,-1044525330),s=n(s,u,a,h,o[4],7,-176418897),h=n(h,s,u,a,o[5],12,1200080426),a=n(a,h,s,u,o[6],17,-1473231341),u=n(u,a,h,s,o[7],22,-45705983),s=n(s,u,a,h,o[8],7,1770035416),h=n(h,s,u,a,o[9],12,-1958414417),a=n(a,h,s,u,o[10],17,-42063),u=n(u,a,h,s,o[11],22,-1990404162),s=n(s,u,a,h,o[12],7,1804603682),h=n(h,s,u,a,o[13],12,-40341101),a=n(a,h,s,u,o[14],17,-1502002290),u=n(u,a,h,s,o[15],22,1236535329),s=e(s,u,a,h,o[1],5,-165796510),h=e(h,s,u,a,o[6],9,-1069501632),a=e(a,h,s,u,o[11],14,643717713),u=e(u,a,h,s,o[0],20,-373897302),s=e(s,u,a,h,o[5],5,-701558691),h=e(h,s,u,a,o[10],9,38016083),a=e(a,h,s,u,o[15],14,-660478335),u=e(u,a,h,s,o[4],20,-405537848),s=e(s,u,a,h,o[9],5,568446438),h=e(h,s,u,a,o[14],9,-1019803690),a=e(a,h,s,u,o[3],14,-187363961),u=e(u,a,h,s,o[8],20,1163531501),s=e(s,u,a,h,o[13],5,-1444681467),h=e(h,s,u,a,o[2],9,-51403784),a=e(a,h,s,u,o[7],14,1735328473),u=e(u,a,h,s,o[12],20,-1926607734),s=i(s,u,a,h,o[5],4,-378558),h=i(h,s,u,a,o[8],11,-2022574463),a=i(a,h,s,u,o[11],16,1839030562),u=i(u,a,h,s,o[14],23,-35309556),s=i(s,u,a,h,o[1],4,-1530992060),h=i(h,s,u,a,o[4],11,1272893353),a=i(a,h,s,u,o[7],16,-155497632),u=i(u,a,h,s,o[10],23,-1094730640),s=i(s,u,a,h,o[13],4,681279174),h=i(h,s,u,a,o[0],11,-358537222),a=i(a,h,s,u,o[3],16,-722521979),u=i(u,a,h,s,o[6],23,76029189),s=i(s,u,a,h,o[9],4,-640364487),h=i(h,s,u,a,o[12],11,-421815835),a=i(a,h,s,u,o[15],16,530742520),u=i(u,a,h,s,o[2],23,-995338651),s=f(s,u,a,h,o[0],6,-198630844),h=f(h,s,u,a,o[7],10,1126891415),a=f(a,h,s,u,o[14],15,-1416354905),u=f(u,a,h,s,o[5],21,-57434055),s=f(s,u,a,h,o[12],6,1700485571),h=f(h,s,u,a,o[3],10,-1894986606),a=f(a,h,s,u,o[10],15,-1051523),u=f(u,a,h,s,o[1],21,-2054922799),s=f(s,u,a,h,o[8],6,1873313359),h=f(h,s,u,a,o[15],10,-30611744),a=f(a,h,s,u,o[6],15,-1560198380),u=f(u,a,h,s,o[13],21,1309151649),s=f(s,u,a,h,o[4],6,-145523070),h=f(h,s,u,a,o[11],10,-1120210379),a=f(a,h,s,u,o[2],15,718787259),u=f(u,a,h,s,o[9],21,-343485551),r[0]=t(s,r[0]),r[1]=t(u,r[1]),r[2]=t(a,r[2]),r[3]=t(h,r[3])},s=function(t){var r,n=[];for(r=0;64>r;r+=4)n[r>>2]=t.charCodeAt(r)+(t.charCodeAt(r+1)<<8)+(t.charCodeAt(r+2)<<16)+(t.charCodeAt(r+3)<<24);return n},u=function(t){var r,n=[];for(r=0;64>r;r+=4)n[r>>2]=t[r]+(t[r+1]<<8)+(t[r+2]<<16)+(t[r+3]<<24);return n},a=function(t){var r,n,e,i,f,u,a=t.length,h=[1732584193,-271733879,-1732584194,271733878];for(r=64;a>=r;r+=64)o(h,s(t.substring(r-64,r)));for(t=t.substring(r-64),n=t.length,e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=0;n>r;r+=1)e[r>>2]|=t.charCodeAt(r)<<(r%4<<3);if(e[r>>2]|=128<<(r%4<<3),r>55)for(o(h,e),r=0;16>r;r+=1)e[r]=0;return i=8*a,i=i.toString(16).match(/(.*?)(.{0,8})$/),f=parseInt(i[2],16),u=parseInt(i[1],16)||0,e[14]=f,e[15]=u,o(h,e),h},h=function(t){var r,n,e,i,f,s,a=t.length,h=[1732584193,-271733879,-1732584194,271733878];for(r=64;a>=r;r+=64)o(h,u(t.subarray(r-64,r)));for(t=a>r-64?t.subarray(r-64):new Uint8Array(0),n=t.length,e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=0;n>r;r+=1)e[r>>2]|=t[r]<<(r%4<<3);if(e[r>>2]|=128<<(r%4<<3),r>55)for(o(h,e),r=0;16>r;r+=1)e[r]=0;return i=8*a,i=i.toString(16).match(/(.*?)(.{0,8})$/),f=parseInt(i[2],16),s=parseInt(i[1],16)||0,e[14]=f,e[15]=s,o(h,e),h},c=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],p=function(t){var r,n="";for(r=0;4>r;r+=1)n+=c[t>>8*r+4&15]+c[t>>8*r&15];return n},y=function(t){var r;for(r=0;r<t.length;r+=1)t[r]=p(t[r]);return t.join("")},_=function(t){return y(a(t))},d=func