﻿//-->
var System=System?System:{};System.Security=System.Security?System.Security:{};System.Security.Cryptography=System.Security.Cryptography?System.Security.Cryptography:{};System.Security.Cryptography.SHA1=function(){this.Type="System.Security.Cryptography.SHA1";this.Name="SHA1";this.chrsz=8;var hexcase=0;var b64pad="=";this.ComputeHash=function(value){if(typeof(value)=="string")value=System.Text.Encoding.UTF8.GetBytes(value);var bin=System.BitConverter.ToInt32ArrayBe(value,0);var hash=this.ComputeHashAsBin(bin,value.length*this.chrsz);var bytes=System.BitConverter.GetBytesFromIntegerArrayBe(hash);return bytes;};this.ComputeHashAsHex=function(value){var bytes=this.ComputeHash(value);return System.BitConverter.ToString(bytes,'');};this.ComputeHashAsBase64=function(value){var bytes=this.ComputeHash(value);return System.Convert.ToBase64String(bytes,false);};this.Test=function(){Trace.Write(this.ComputeHashAsHex("abc"));var isSuccess=this.ComputeHashAsHex("abc")=="A9993E364706816ABA3E25717850C26C9CD0D89D";return isSuccess;};this.ComputeHashAsBin=function(x,len){x[len>>5]|=0x80<<(24-len%32);x[((len+64>>9)<<4)+15]=len;var w=Array(80);var a=1732584193;var b= -271733879;var c= -1732584194;var d=271733878;var e= -1009589776;for(var i=0;i<x.length;i+=16){var olda=a;var oldb=b;var oldc=c;var oldd=d;var olde=e;for(var j=0;j<80;j++){if(j<16)w[j]=x[i+j];else w[j]=rotateBitwise(w[j-3]^w[j-8]^w[j-14]^w[j-16],1);var t=addSafe(addSafe(rotateBitwise(a,5),sha1Ft(j,b,c,d)),addSafe(addSafe(e,w[j]),sha1Kt(j)));e=d;d=c;c=rotateBitwise(b,30);b=a;a=t;}a=addSafe(a,olda);b=addSafe(b,oldb);c=addSafe(c,oldc);d=addSafe(d,oldd);e=addSafe(e,olde);}return Array(a,b,c,d,e);};function sha1Ft(t,b,c,d){if(t<20)return(b&c)|((~b)&d);if(t<40)return b^c^d;if(t<60)return(b&c)|(b&d)|(c&d);return b^c^d;};function sha1Kt(t){return(t<20)?1518500249:(t<40)?1859775393:(t<60)? -1894007588: -899497514;};function addSafe(x,y){var lsw=(x&0xFFFF)+(y&0xFFFF);var msw=(x>>16)+(y>>16)+(lsw>>16);return(msw<<16)|(lsw&0xFFFF);};function rotateBitwise(num,cnt){return(num<<cnt)|(num>>>(32-cnt));};this.Initialize=function(){};this.Initialize.apply(this,arguments);};System.Security.Cryptography.SHA1CryptoServiceProvider=System.Security.Cryptography.SHA1;