mirror of https://github.com/gorhill/uBlock.git
23 lines
4.3 KiB
JavaScript
23 lines
4.3 KiB
JavaScript
// project home: https://github.com/gorhill/yamd5.js
|
|
// minified using http://lisperator.net/uglifyjs/
|
|
!function(t){"use strict";var r=function(t,r,e,n,i,s,f){return t+=(r&e|~r&n)+i+f,(t<<s|t>>>32-s)+r|0
|
|
},e=function(t,r,e,n,i,s,f){return t+=(r&n|e&~n)+i+f,(t<<s|t>>>32-s)+r|0},n=function(t,r,e,n,i,s,f){return t+=(r^e^n)+i+f,(t<<s|t>>>32-s)+r|0
|
|
},i=function(t,r,e,n,i,s,f){return t+=(e^(r|~n))+i+f,(t<<s|t>>>32-s)+r|0},s=function(t,s){var f=t[0],a=t[1],h=t[2],o=t[3];
|
|
f=r(f,a,h,o,s[0],7,-680876936),o=r(o,f,a,h,s[1],12,-389564586),h=r(h,o,f,a,s[2],17,606105819),a=r(a,h,o,f,s[3],22,-1044525330),f=r(f,a,h,o,s[4],7,-176418897),o=r(o,f,a,h,s[5],12,1200080426),h=r(h,o,f,a,s[6],17,-1473231341),a=r(a,h,o,f,s[7],22,-45705983),f=r(f,a,h,o,s[8],7,1770035416),o=r(o,f,a,h,s[9],12,-1958414417),h=r(h,o,f,a,s[10],17,-42063),a=r(a,h,o,f,s[11],22,-1990404162),f=r(f,a,h,o,s[12],7,1804603682),o=r(o,f,a,h,s[13],12,-40341101),h=r(h,o,f,a,s[14],17,-1502002290),a=r(a,h,o,f,s[15],22,1236535329),f=e(f,a,h,o,s[1],5,-165796510),o=e(o,f,a,h,s[6],9,-1069501632),h=e(h,o,f,a,s[11],14,643717713),a=e(a,h,o,f,s[0],20,-373897302),f=e(f,a,h,o,s[5],5,-701558691),o=e(o,f,a,h,s[10],9,38016083),h=e(h,o,f,a,s[15],14,-660478335),a=e(a,h,o,f,s[4],20,-405537848),f=e(f,a,h,o,s[9],5,568446438),o=e(o,f,a,h,s[14],9,-1019803690),h=e(h,o,f,a,s[3],14,-187363961),a=e(a,h,o,f,s[8],20,1163531501),f=e(f,a,h,o,s[13],5,-1444681467),o=e(o,f,a,h,s[2],9,-51403784),h=e(h,o,f,a,s[7],14,1735328473),a=e(a,h,o,f,s[12],20,-1926607734),f=n(f,a,h,o,s[5],4,-378558),o=n(o,f,a,h,s[8],11,-2022574463),h=n(h,o,f,a,s[11],16,1839030562),a=n(a,h,o,f,s[14],23,-35309556),f=n(f,a,h,o,s[1],4,-1530992060),o=n(o,f,a,h,s[4],11,1272893353),h=n(h,o,f,a,s[7],16,-155497632),a=n(a,h,o,f,s[10],23,-1094730640),f=n(f,a,h,o,s[13],4,681279174),o=n(o,f,a,h,s[0],11,-358537222),h=n(h,o,f,a,s[3],16,-722521979),a=n(a,h,o,f,s[6],23,76029189),f=n(f,a,h,o,s[9],4,-640364487),o=n(o,f,a,h,s[12],11,-421815835),h=n(h,o,f,a,s[15],16,530742520),a=n(a,h,o,f,s[2],23,-995338651),f=i(f,a,h,o,s[0],6,-198630844),o=i(o,f,a,h,s[7],10,1126891415),h=i(h,o,f,a,s[14],15,-1416354905),a=i(a,h,o,f,s[5],21,-57434055),f=i(f,a,h,o,s[12],6,1700485571),o=i(o,f,a,h,s[3],10,-1894986606),h=i(h,o,f,a,s[10],15,-1051523),a=i(a,h,o,f,s[1],21,-2054922799),f=i(f,a,h,o,s[8],6,1873313359),o=i(o,f,a,h,s[15],10,-30611744),h=i(h,o,f,a,s[6],15,-1560198380),a=i(a,h,o,f,s[13],21,1309151649),f=i(f,a,h,o,s[4],6,-145523070),o=i(o,f,a,h,s[11],10,-1120210379),h=i(h,o,f,a,s[2],15,718787259),a=i(a,h,o,f,s[9],21,-343485551),t[0]=f+t[0]|0,t[1]=a+t[1]|0,t[2]=h+t[2]|0,t[3]=o+t[3]|0
|
|
},f=function(t){for(var r,e,n="0123456789abcdef",i=[],s=0;s<t.length;s++){e=8*s,r=t[s];
|
|
for(var f=0;8>f;f+=2)i[e+1+f]=n.charAt(15&r),r>>>=4,i[e+0+f]=n.charAt(15&r),r>>>=4
|
|
}return i.join("")},a=function(){this._dataLength=0,this._state=new Int32Array(4),this._buffer=new ArrayBuffer(68),this._bufferLength=0,this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()
|
|
};a.prototype.appendStr=function(t){for(var r,e=this._buffer8,n=this._buffer32,i=this._bufferLength,f=0;f<t.length;f++){if(r=t.charCodeAt(f),128>r)e[i++]=r;
|
|
else if(2048>r)e[i++]=(r>>>6)+192,e[i++]=63&r|128;else if(55296>r||r>56319)e[i++]=(r>>>12)+224,e[i++]=r>>>6&63|128,e[i++]=63&r|128;
|
|
else{if(r=1024*(r-55296)+(t.charCodeAt(++f)-56320)+65536,r>1114111)throw"Unicode standard supports code points up to U+10FFFF";
|
|
e[i++]=(r>>>18)+240,e[i++]=r>>>12&63|128,e[i++]=r>>>6&63|128,e[i++]=63&r|128}if(i>=64)this._dataLength+=64,s(this._state,n),i-=64,n[0]=n[16]
|
|
}return this._bufferLength=i,this},a.prototype.start=function(){this._dataLength=0,this._bufferLength=0;
|
|
var t=this._state;return t[0]=1732584193,t[1]=-271733879,t[2]=-1732584194,t[3]=271733878,this
|
|
},a.prototype.end=function(t){var r=this._bufferLength;this._dataLength+=r;var e=this._buffer8;
|
|
e[r]=128,e[r+1]=e[r+2]=e[r+3]=0;var n,i=this._buffer32;for(n=(r>>2)+1;16>n;n++)i[n]=0;
|
|
if(r>55)for(s(this._state,i),n=0;16>n;n++)i[n]=0;var a=8*this._dataLength;if(4294967295>=a)i[14]=a;
|
|
else{var h=a.toString(16).match(/(.*?)(.{0,8})$/),o=parseInt(h[2],16),u=parseInt(h[1],16)||0;
|
|
i[14]=o,i[15]=u}return s(this._state,i),t?this._state:f(this._state)};var h=new a;
|
|
if(a.hashStr=function(t,r){return h.start().appendStr(t).end(r)},"5d41402abc4b2a76b9719d911017c592"!==a.hashStr("hello"))throw"This javascript engine does not support YaMD5. Sorry.";
|
|
if("object"==typeof t)t.YaMD5=a;return a}(this);
|