OpenAuth_server/views/shared/sha512.js

1 line
7.4 KiB
JavaScript
Raw Permalink Normal View History

2018-11-06 19:48:50 +00:00
var b;if(!(b=t)){var w=Math,y={},B=y.p={},aa=function(){},C=B.A={extend:function(o){aa.prototype=this;var _=new aa;return o&&_.u(o),_.z=this,_},create:function(){var o=this.extend();return o.h.apply(o,arguments),o},h:function(){},u:function(o){for(var _ in o)o.hasOwnProperty(_)&&(this[_]=o[_]);o.hasOwnProperty("toString")&&(this.toString=o.toString)},e:function(){return this.z.extend(this)}},D=B.i=C.extend({h:function(o,_){o=this.d=o||[],this.c=void 0==_?4*o.length:_},toString:function(o){return(o||ba).stringify(this)},concat:function(o){var _=this.d,Da=o.d,Ea=this.c,o=o.c;if(this.t(),Ea%4)for(var Fa=0;Fa<o;Fa++)_[Ea+Fa>>>2]|=(255&Da[Fa>>>2]>>>24-8*(Fa%4))<<24-8*((Ea+Fa)%4);else if(65535<Da.length)for(Fa=0;Fa<o;Fa+=4)_[Ea+Fa>>>2]=Da[Fa>>>2];else _.push.apply(_,Da);return this.c+=o,this},t:function(){var o=this.d,_=this.c;o[_>>>2]&=4294967295<<32-8*(_%4),o.length=w.ceil(_/4)},e:function(){var o=C.e.call(this);return o.d=this.d.slice(0),o},random:function(o){for(var _=[],Da=0;Da<o;Da+=4)_.push(0|4294967296*w.random());return D.create(_,o)}}),ca=y.O={},ba=ca.K={stringify:function(o){for(var Fa,_=o.d,o=o.c,Da=[],Ea=0;Ea<o;Ea++)Fa=255&_[Ea>>>2]>>>24-8*(Ea%4),Da.push((Fa>>>4).toString(16)),Da.push((15&Fa).toString(16));return Da.join("")},parse:function(o){for(var _=o.length,Da=[],Ea=0;Ea<_;Ea+=2)Da[Ea>>>3]|=parseInt(o.substr(Ea,2),16)<<24-4*(Ea%8);return D.create(Da,_/2)}},da=ca.M={stringify:function(o){for(var _=o.d,o=o.c,Da=[],Ea=0;Ea<o;Ea++)Da.push(String.fromCharCode(255&_[Ea>>>2]>>>24-8*(Ea%4)));return Da.join("")},parse:function(o){for(var _=o.length,Da=[],Ea=0;Ea<_;Ea++)Da[Ea>>>2]|=(255&o.charCodeAt(Ea))<<24-8*(Ea%4);return D.create(Da,_)}},ea=ca.N={stringify:function(o){try{return decodeURIComponent(escape(da.stringify(o)))}catch(_){throw Error("Malformed UTF-8 data")}},parse:function(o){return da.parse(unescape(encodeURIComponent(o)))}},ia=B.I=C.extend({reset:function(){this.g=D.create(),this.j=0},l:function(o){"string"==typeof o&&(o=ea.parse(o)),this.g.concat(o),this.j+=o.c},m:function(o){var _=this.g,Da=_.d,Ea=_.c,Fa=this.n,Ga=Ea/(4*Fa),Ga=o?w.ceil(Ga):w.max((0|Ga)-this.r,0),o=Ga*Fa,Ea=w.min(4*o,Ea);if(o){for(var Ha=0;Ha<o;Ha+=Fa)this.H(Da,Ha);Ha=Da.splice(0,o),_.c-=Ea}return D.create(Ha,Ea)},e:function(){var o=C.e.call(this);return o.g=this.g.e(),o},r:0});B.B=ia.extend({h:function(){this.reset()},reset:function(){ia.reset.call(this),this.q()},update:function(o){return this.l(o),this.m(),this},o:function(o){return o&&this.l(o),this.G(),this.f},e:function(){var o=ia.e.call(this);return o.f=this.f.e(),o},n:16,D:function(o){return function(_,Da){return o.create(Da).o(_)}},F:function(o){return function(_,Da){return ja.J.create(o,Da).o(_)}}});var ja=y.s={};b=y}var t=b,K=t,ka=K.p,la=ka.A,va=ka.i,K=K.w={};K.C=la.extend({h:function(o,_){this.a=o,this.b=_}}),K.i=la.extend({h:function(o,_){o=this.d=o||[],this.c=void 0==_?8*o.length:_},v:function(){for(var Fa,o=this.d,_=o.length,Da=[],Ea=0;Ea<_;Ea++)Fa=o[Ea],Da.push(Fa.a),Da.push(Fa.b);return va.create(Da,this.c)},e:function(){for(var o=la.e.call(this),_=o.d=this.d.slice(0),Da=_.length,Ea=0;Ea<Da;Ea++)_[Ea]=_[Ea].e();return o}});function L(){return wa.create.apply(wa,arguments)}for(var xa=t.p.B,M=t.w,wa=M.C,ya=M.i,M=t.s,za=[L(1116352408,3609767458),L(1899447441,602891725),L(3049323471,3964484399),L(3921009573,2173295548),L(961987163,4081628472),L(1508970993,3053834265),L(2453635748,2937671579),L(2870763221,3664609560),L(3624381080,2734883394),L(310598401,1164996542),L(607225278,1323610764),L(1426881987,3590304994),L(1925078388,4068182383),L(2162078206,991336113),L(2614888103,633803317),L(3248222580,3479774868),L(3835390401,2666613458),L(4022224774,944711139),L(264347078,2341262773),L(604807628,2007800933),L(770255983,1495990901),L(1249150122,1856431235),L(1555081692,3175218132),L(1996064986,2198950837),L(2554220882,3999719339),L(2821834349,766784016),L(2952996808,2566594879),L(3210313671,3203337956),L(3336571891,1034457026),L(3584528711,2466948901),L(113926993,3758326383),L(338241895,168717936),L(666307205,1188179964),L(773529912,1546045734),L(1294757372,1522805485),L(139618