UNPKG

node-forge-dist

Version:

JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.

2 lines 41.9 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.forge=e():t.forge=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var a=r[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=10)}([function(t,e){t.exports={options:{usePureJavaScript:!1}}},function(t,e,r){var n=r(0);t.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},function(t,e,r){function n(t){if(8!==t&&16!==t&&24!==t&&32!==t)throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}function a(t){if(this.data="",this.read=0,"string"==typeof t)this.data=t;else if(s.isArrayBuffer(t)||s.isArrayBufferView(t)){var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch(t){for(var r=0;r<e.length;++r)this.putByte(e[r])}}else(t instanceof a||"object"==typeof t&&"string"==typeof t.data&&"number"==typeof t.read)&&(this.data=t.data,this.read=t.read);this._constructedStringLength=0}function i(t,e){e=e||{},this.read=e.readOffset||0,this.growSize=e.growSize||1024;var r=s.isArrayBuffer(t),n=s.isArrayBufferView(t);if(r||n)return this.data=r?new DataView(t):new DataView(t.buffer,t.byteOffset,t.byteLength),void(this.write="writeOffset"in e?e.writeOffset:this.data.byteLength);this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!==t&&void 0!==t&&this.putBytes(t),"writeOffset"in e&&(this.write=e.writeOffset)}var o=r(0),s=t.exports=o.util=o.util||{};!function(){function t(t){if(t.source===window&&t.data===e){t.stopPropagation();var n=r.slice();r.length=0,n.forEach(function(t){t()})}}if("undefined"!=typeof process&&process.nextTick)return s.nextTick=process.nextTick,void("function"==typeof setImmediate?s.setImmediate=setImmediate:s.setImmediate=s.nextTick);if("function"==typeof setImmediate)return s.setImmediate=function(){return setImmediate.apply(void 0,arguments)},void(s.nextTick=function(t){return setImmediate(t)});if(s.setImmediate=function(t){setTimeout(t,0)},"undefined"!=typeof window&&"function"==typeof window.postMessage){var e="forge.setImmediate",r=[];s.setImmediate=function(t){r.push(t),1===r.length&&window.postMessage(e,"*")},window.addEventListener("message",t,!0)}if("undefined"!=typeof MutationObserver){var n=Date.now(),a=!0,i=document.createElement("div"),r=[];new MutationObserver(function(){var t=r.slice();r.length=0,t.forEach(function(t){t()})}).observe(i,{attributes:!0});var o=s.setImmediate;s.setImmediate=function(t){Date.now()-n>15?(n=Date.now(),o(t)):(r.push(t),1===r.length&&i.setAttribute("a",a=!a))}}s.nextTick=s.setImmediate}(),s.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,s.isArray=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},s.isArrayBuffer=function(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer},s.isArrayBufferView=function(t){return t&&s.isArrayBuffer(t.buffer)&&void 0!==t.byteLength},s.ByteBuffer=a,s.ByteStringBuffer=a;s.ByteStringBuffer.prototype._optimizeConstructedString=function(t){this._constructedStringLength+=t,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},s.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},s.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},s.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))},s.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)1&e&&(r+=t),(e>>>=1)>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this},s.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this},s.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(s.encodeUtf8(t))},s.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},s.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},s.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},s.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255))},s.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))},s.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))},s.ByteStringBuffer.prototype.putInt=function(t,e){n(e);var r="";do{e-=8,r+=String.fromCharCode(t>>e&255)}while(e>0);return this.putBytes(r)},s.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<<e-1),this.putInt(t,e)},s.ByteStringBuffer.prototype.putBuffer=function(t){return this.putBytes(t.getBytes())},s.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},s.ByteStringBuffer.prototype.getInt16=function(){var t=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,t},s.ByteStringBuffer.prototype.getInt24=function(){var t=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,t},s.ByteStringBuffer.prototype.getInt32=function(){var t=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,t},s.ByteStringBuffer.prototype.getInt16Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,t},s.ByteStringBuffer.prototype.getInt24Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,t},s.ByteStringBuffer.prototype.getInt32Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,t},s.ByteStringBuffer.prototype.getInt=function(t){n(t);var e=0;do{e=(e<<8)+this.data.charCodeAt(this.read++),t-=8}while(t>0);return e},s.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<<t-2;return e>=r&&(e-=r<<1),e},s.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},s.ByteStringBuffer.prototype.bytes=function(t){return void 0===t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},s.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)},s.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this},s.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},s.ByteStringBuffer.prototype.copy=function(){var t=s.createBuffer(this.data);return t.read=this.read,t},s.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},s.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},s.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this},s.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e<this.data.length;++e){var r=this.data.charCodeAt(e);r<16&&(t+="0"),t+=r.toString(16)}return t},s.ByteStringBuffer.prototype.toString=function(){return s.decodeUtf8(this.bytes())},s.DataBuffer=i,s.DataBuffer.prototype.length=function(){return this.write-this.read},s.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},s.DataBuffer.prototype.accommodate=function(t,e){if(this.length()>=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this},s.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this},s.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r<e;++r)this.data.setUint8(t);return this},s.DataBuffer.prototype.putBytes=function(t,e){if(s.isArrayBufferView(t)){var r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),n=r.byteLength-r.byteOffset;this.accommodate(n);var a=new Uint8Array(this.data.buffer,this.write);return a.set(r),this.write+=n,this}if(s.isArrayBuffer(t)){var r=new Uint8Array(t);this.accommodate(r.byteLength);var a=new Uint8Array(this.data.buffer);return a.set(r,this.write),this.write+=r.byteLength,this}if(t instanceof s.DataBuffer||"object"==typeof t&&"number"==typeof t.read&&"number"==typeof t.write&&s.isArrayBufferView(t.data)){var r=new Uint8Array(t.data.byteLength,t.read,t.length());this.accommodate(r.byteLength);var a=new Uint8Array(t.data.byteLength,this.write);return a.set(r),this.write+=r.byteLength,this}if(t instanceof s.ByteStringBuffer&&(t=t.data,e="binary"),e=e||"binary","string"==typeof t){var i;if("hex"===e)return this.accommodate(Math.ceil(t.length/2)),i=new Uint8Array(this.data.buffer,this.write),this.write+=s.binary.hex.decode(t,i,this.write),this;if("base64"===e)return this.accommodate(3*Math.ceil(t.length/4)),i=new Uint8Array(this.data.buffer,this.write),this.write+=s.binary.base64.decode(t,i,this.write),this;if("utf8"===e&&(t=s.encodeUtf8(t),e="binary"),"binary"===e||"raw"===e)return this.accommodate(t.length),i=new Uint8Array(this.data.buffer,this.write),this.write+=s.binary.raw.decode(i),this;if("utf16"===e)return this.accommodate(2*t.length),i=new Uint16Array(this.data.buffer,this.write),this.write+=s.text.utf16.encode(i),this;throw new Error("Invalid encoding: "+e)}throw Error("Invalid parameter: "+t)},s.DataBuffer.prototype.putBuffer=function(t){return this.putBytes(t),t.clear(),this},s.DataBuffer.prototype.putString=function(t){return this.putBytes(t,"utf16")},s.DataBuffer.prototype.putInt16=function(t){return this.accommodate(2),this.data.setInt16(this.write,t),this.write+=2,this},s.DataBuffer.prototype.putInt24=function(t){return this.accommodate(3),this.data.setInt16(this.write,t>>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this},s.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this},s.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this},s.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this},s.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this},s.DataBuffer.prototype.putInt=function(t,e){n(e),this.accommodate(e/8);do{e-=8,this.data.setInt8(this.write++,t>>e&255)}while(e>0);return this},s.DataBuffer.prototype.putSignedInt=function(t,e){return n(e),this.accommodate(e/8),t<0&&(t+=2<<e-1),this.putInt(t,e)},s.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},s.DataBuffer.prototype.getInt16=function(){var t=this.data.getInt16(this.read);return this.read+=2,t},s.DataBuffer.prototype.getInt24=function(){var t=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,t},s.DataBuffer.prototype.getInt32=function(){var t=this.data.getInt32(this.read);return this.read+=4,t},s.DataBuffer.prototype.getInt16Le=function(){var t=this.data.getInt16(this.read,!0);return this.read+=2,t},s.DataBuffer.prototype.getInt24Le=function(){var t=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,t},s.DataBuffer.prototype.getInt32Le=function(){var t=this.data.getInt32(this.read,!0);return this.read+=4,t},s.DataBuffer.prototype.getInt=function(t){n(t);var e=0;do{e=(e<<8)+this.data.getInt8(this.read++),t-=8}while(t>0);return e},s.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<<t-2;return e>=r&&(e-=r<<1),e},s.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},s.DataBuffer.prototype.bytes=function(t){return void 0===t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},s.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)},s.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this},s.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},s.DataBuffer.prototype.copy=function(){return new s.DataBuffer(this)},s.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this},s.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},s.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this},s.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e<this.data.byteLength;++e){var r=this.data.getUint8(e);r<16&&(t+="0"),t+=r.toString(16)}return t},s.DataBuffer.prototype.toString=function(t){var e=new Uint8Array(this.data,this.read,this.length());if("binary"===(t=t||"utf8")||"raw"===t)return s.binary.raw.encode(e);if("hex"===t)return s.binary.hex.encode(e);if("base64"===t)return s.binary.base64.encode(e);if("utf8"===t)return s.text.utf8.decode(e);if("utf16"===t)return s.text.utf16.decode(e);throw new Error("Invalid encoding: "+t)},s.createBuffer=function(t,e){return e=e||"raw",void 0!==t&&"utf8"===e&&(t=s.encodeUtf8(t)),new s.ByteBuffer(t)},s.fillString=function(t,e){for(var r="";e>0;)1&e&&(r+=t),(e>>>=1)>0&&(t+=t);return r},s.xorBytes=function(t,e,r){for(var n="",a="",i="",o=0,s=0;r>0;--r,++o)a=t.charCodeAt(o)^e.charCodeAt(o),s>=10&&(n+=i,i="",s=0),i+=String.fromCharCode(a),++s;return n+=i},s.hexToBytes=function(t){var e="",r=0;for(!0&t.length&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r<t.length;r+=2)e+=String.fromCharCode(parseInt(t.substr(r,2),16));return e},s.bytesToHex=function(t){return s.createBuffer(t).toHex()},s.int32ToBytes=function(t){return String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)};var h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51];s.encode64=function(t,e){for(var r,n,a,i="",o="",s=0;s<t.length;)r=t.charCodeAt(s++),n=t.charCodeAt(s++),a=t.charCodeAt(s++),i+=h.charAt(r>>2),i+=h.charAt((3&r)<<4|n>>4),isNaN(n)?i+="==":(i+=h.charAt((15&n)<<2|a>>6),i+=isNaN(a)?"=":h.charAt(63&a)),e&&i.length>e&&(o+=i.substr(0,e)+"\r\n",i=i.substr(e));return o+=i},s.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e,r,n,a,i="",o=0;o<t.length;)e=u[t.charCodeAt(o++)-43],r=u[t.charCodeAt(o++)-43],n=u[t.charCodeAt(o++)-43],a=u[t.charCodeAt(o++)-43],i+=String.fromCharCode(e<<2|r>>4),64!==n&&(i+=String.fromCharCode((15&r)<<4|n>>2),64!==a&&(i+=String.fromCharCode((3&n)<<6|a)));return i},s.encodeUtf8=function(t){return unescape(encodeURIComponent(t))},s.decodeUtf8=function(t){return decodeURIComponent(escape(t))},s.binary={raw:{},hex:{},base64:{}},s.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)},s.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var a=r,i=0;i<t.length;++i)n[a++]=t.charCodeAt(i);return e?a-r:n},s.binary.hex.encode=s.bytesToHex,s.binary.hex.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/2))),r=r||0;var a=0,i=r;for(1&t.length&&(a=1,n[i++]=parseInt(t[0],16));a<t.length;a+=2)n[i++]=parseInt(t.substr(a,2),16);return e?i-r:n},s.binary.base64.encode=function(t,e){for(var r,n,a,i="",o="",s=0;s<t.byteLength;)r=t[s++],n=t[s++],a=t[s++],i+=h.charAt(r>>2),i+=h.charAt((3&r)<<4|n>>4),isNaN(n)?i+="==":(i+=h.charAt((15&n)<<2|a>>6),i+=isNaN(a)?"=":h.charAt(63&a)),e&&i.length>e&&(o+=i.substr(0,e)+"\r\n",i=i.substr(e));return o+=i},s.binary.base64.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(3*Math.ceil(t.length/4))),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var a,i,o,s,h=0,f=r;h<t.length;)a=u[t.charCodeAt(h++)-43],i=u[t.charCodeAt(h++)-43],o=u[t.charCodeAt(h++)-43],s=u[t.charCodeAt(h++)-43],n[f++]=a<<2|i>>4,64!==o&&(n[f++]=(15&i)<<4|o>>2,64!==s&&(n[f++]=(3&o)<<6|s));return e?f-r:n.subarray(0,f)},s.text={utf8:{},utf16:{}},s.text.utf8.encode=function(t,e,r){t=s.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var a=r,i=0;i<t.length;++i)n[a++]=t.charCodeAt(i);return e?a-r:n},s.text.utf8.decode=function(t){return s.decodeUtf8(String.fromCharCode.apply(null,t))},s.text.utf16.encode=function(t,e,r){var n=e;n||(n=new Uint8Array(2*t.length));var a=new Uint16Array(n.buffer);r=r||0;for(var i=r,o=r,s=0;s<t.length;++s)a[o++]=t.charCodeAt(s),i+=2;return e?i-r:n},s.text.utf16.decode=function(t){return String.fromCharCode.apply(null,new Uint16Array(t.buffer))},s.deflate=function(t,e,r){if(e=s.decode64(t.deflate(s.encode64(e)).rval),r){var n=2;32&e.charCodeAt(1)&&(n=6),e=e.substring(n,e.length-4)}return e},s.inflate=function(t,e,r){var n=t.inflate(s.encode64(e)).rval;return null===n?null:s.decode64(n)};var f=function(t,e,r){if(!t)throw new Error("WebStorage not available.");var n;if(null===r?n=t.removeItem(e):(r=s.encode64(JSON.stringify(r)),n=t.setItem(e,r)),void 0!==n&&!0!==n.rval){var a=new Error(n.error.message);throw a.id=n.error.id,a.name=n.error.name,a}},l=function(t,e){if(!t)throw new Error("WebStorage not available.");var r=t.getItem(e);if(t.init)if(null===r.rval){if(r.error){var n=new Error(r.error.message);throw n.id=r.error.id,n.name=r.error.name,n}r=null}else r=r.rval;return null!==r&&(r=JSON.parse(s.decode64(r))),r},g=function(t,e,r,n){var a=l(t,e);null===a&&(a={}),a[r]=n,f(t,e,a)},c=function(t,e,r){var n=l(t,e);return null!==n&&(n=r in n?n[r]:null),n},d=function(t,e,r){var n=l(t,e);if(null!==n&&r in n){delete n[r];var a=!0;for(var i in n){a=!1;break}a&&(n=null),f(t,e,n)}},p=function(t,e){f(t,e,null)},y=function(t,e,r){var n=null;void 0===r&&(r=["web","flash"]);var a,i=!1,o=null;for(var s in r){a=r[s];try{if("flash"===a||"both"===a){if(null===e[0])throw new Error("Flash local storage not available.");n=t.apply(this,e),i="flash"===a}"web"!==a&&"both"!==a||(e[0]=localStorage,n=t.apply(this,e),i=!0)}catch(t){o=t}if(i)break}if(!i)throw o;return n};s.setItem=function(t,e,r,n,a){y(g,arguments,a)},s.getItem=function(t,e,r,n){return y(c,arguments,n)},s.removeItem=function(t,e,r,n){y(d,arguments,n)},s.clearItems=function(t,e,r){y(p,arguments,r)},s.parseUrl=function(t){var e=/^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g;e.lastIndex=0;var r=e.exec(t),n=null===r?null:{full:t,scheme:r[1],host:r[2],port:r[3],path:r[4]};return n&&(n.fullHost=n.host,n.port?80!==n.port&&"http"===n.scheme?n.fullHost+=":"+n.port:443!==n.port&&"https"===n.scheme&&(n.fullHost+=":"+n.port):"http"===n.scheme?n.port=80:"https"===n.scheme&&(n.port=443),n.full=n.scheme+"://"+n.fullHost),n};var m=null;s.getQueryVariables=function(t){var e,r=function(t){for(var e={},r=t.split("&"),n=0;n<r.length;n++){var a,i,o=r[n].indexOf("=");o>0?(a=r[n].substring(0,o),i=r[n].substring(o+1)):(a=r[n],i=null),a in e||(e[a]=[]),a in Object.prototype||null===i||e[a].push(unescape(i))}return e};return void 0===t?(null===m&&(m="undefined"!=typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),e=m):e=r(t),e},s.parseFragment=function(t){var e=t,r="",n=t.indexOf("?");n>0&&(e=t.substring(0,n),r=t.substring(n+1));var a=e.split("/");return a.length>0&&""===a[0]&&a.shift(),{pathString:e,queryString:r,path:a,query:""===r?{}:s.getQueryVariables(r)}},s.makeRequest=function(t){var e=s.parseFragment(t),r={path:e.pathString,query:e.queryString,getPath:function(t){return void 0===t?e.path:e.path[t]},getQuery:function(t,r){var n;return void 0===t?n=e.query:(n=e.query[t])&&void 0!==r&&(n=n[r]),n},getQueryLast:function(t,e){var n=r.getQuery(t);return n?n[n.length-1]:e}};return r},s.makeLink=function(t,e,r){t=jQuery.isArray(t)?t.join("/"):t;var n=jQuery.param(e||{});return r=r||"",t+(n.length>0?"?"+n:"")+(r.length>0?"#"+r:"")},s.setPath=function(t,e,r){if("object"==typeof t&&null!==t)for(var n=0,a=e.length;n<a;){var i=e[n++];if(n==a)t[i]=r;else{var o=i in t;(!o||o&&"object"!=typeof t[i]||o&&null===t[i])&&(t[i]={}),t=t[i]}}},s.getPath=function(t,e,r){for(var n=0,a=e.length,i=!0;i&&n<a&&"object"==typeof t&&null!==t;){var o=e[n++];i=o in t,i&&(t=t[o])}return i?t:r},s.deletePath=function(t,e){if("object"==typeof t&&null!==t)for(var r=0,n=e.length;r<n;){var a=e[r++];if(r==n)delete t[a];else{if(!(a in t)||"object"!=typeof t[a]||null===t[a])break;t=t[a]}}},s.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0},s.format=function(t){for(var e,r,n=/%./g,a=0,i=[],o=0;e=n.exec(t);){r=t.substring(o,n.lastIndex-2),r.length>0&&i.push(r),o=n.lastIndex;var s=e[0][1];switch(s){case"s":case"o":a<arguments.length?i.push(arguments[1+a++]):i.push("<?>");break;case"%":i.push("%");break;default:i.push("<%"+s+"?>")}}return i.push(t.substring(o)),i.join("")},s.formatNumber=function(t,e,r,n){var a=t,i=isNaN(e=Math.abs(e))?2:e,o=void 0===r?",":r,s=void 0===n?".":n,h=a<0?"-":"",u=parseInt(a=Math.abs(+a||0).toFixed(i),10)+"",f=u.length>3?u.length%3:0;return h+(f?u.substr(0,f)+s:"")+u.substr(f).replace(/(\d{3})(?=\d)/g,"$1"+s)+(i?o+Math.abs(a-u).toFixed(i).slice(2):"")},s.formatSize=function(t){return t=t>=1073741824?s.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?s.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?s.formatNumber(t/1024,0)+" KiB":s.formatNumber(t,0)+" bytes"},s.bytesFromIP=function(t){return-1!==t.indexOf(".")?s.bytesFromIPv4(t):-1!==t.indexOf(":")?s.bytesFromIPv6(t):null},s.bytesFromIPv4=function(t){if(t=t.split("."),4!==t.length)return null;for(var e=s.createBuffer(),r=0;r<t.length;++r){var n=parseInt(t[r],10);if(isNaN(n))return null;e.putByte(n)}return e.getBytes()},s.bytesFromIPv6=function(t){var e=0;t=t.split(":").filter(function(t){return 0===t.length&&++e,!0});for(var r=2*(8-t.length+e),n=s.createBuffer(),a=0;a<8;++a)if(t[a]&&0!==t[a].length){var i=s.hexToBytes(t[a]);i.length<2&&n.putByte(0),n.putBytes(i)}else n.fillWithByte(0,r),r=0;return n.getBytes()},s.bytesToIP=function(t){return 4===t.length?s.bytesToIPv4(t):16===t.length?s.bytesToIPv6(t):null},s.bytesToIPv4=function(t){if(4!==t.length)return null;for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e.join(".")},s.bytesToIPv6=function(t){if(16!==t.length)return null;for(var e=[],r=[],n=0,a=0;a<t.length;a+=2){for(var i=s.bytesToHex(t[a]+t[a+1]);"0"===i[0]&&"0"!==i;)i=i.substr(1);if("0"===i){var o=r[r.length-1],h=e.length;o&&h===o.end+1?(o.end=h,o.end-o.start>r[n].end-r[n].start&&(n=r.length-1)):r.push({start:h,end:h})}e.push(i)}if(r.length>0){var u=r[n];u.end-u.start>0&&(e.splice(u.start,u.end-u.start+1,""),0===u.start&&e.unshift(""),7===u.end&&e.push(""))}return e.join(":")},s.estimateCores=function(t,e){function r(t,o,h){if(0===o){var u=Math.floor(t.reduce(function(t,e){return t+e},0)/t.length);return s.cores=Math.max(1,u),URL.revokeObjectURL(i),e(null,s.cores)}n(h,function(e,n){t.push(a(h,n)),r(t,o-1,h)})}function n(t,e){for(var r=[],n=[],a=0;a<t;++a){var o=new Worker(i);o.addEventListener("message",function(a){if(n.push(a.data),n.length===t){for(var i=0;i<t;++i)r[i].terminate();e(null,n)}}),r.push(o)}for(var a=0;a<t;++a)r[a].postMessage(a)}function a(t,e){for(var r=[],n=0;n<t;++n)for(var a=e[n],i=r[n]=[],o=0;o<t;++o)if(n!==o){var s=e[o];(a.st>s.st&&a.st<s.et||s.st>a.st&&s.st<a.et)&&i.push(o)}return r.reduce(function(t,e){return Math.max(t,e.length)},0)}if("function"==typeof t&&(e=t,t={}),t=t||{},"cores"in s&&!t.update)return e(null,s.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return s.cores=navigator.hardwareConcurrency,e(null,s.cores);if("undefined"==typeof Worker)return s.cores=1,e(null,s.cores);if("undefined"==typeof Blob)return s.cores=2,e(null,s.cores);var i=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(t){for(var e=Date.now(),r=e+4;Date.now()<r;);self.postMessage({st:e,et:r})})}.toString(),")()"],{type:"application/javascript"}));r([],5,16)}},function(t,e,r){t.exports=r(0),r(4),r(5),r(2)},function(t,e,r){var n=r(0);r(1),r(2),(t.exports=n.hmac=n.hmac||{}).create=function(){var t=null,e=null,r=null,a=null,i={};return i.start=function(i,o){if(null!==i)if("string"==typeof i){if(!((i=i.toLowerCase())in n.md.algorithms))throw new Error('Unknown hash algorithm "'+i+'"');e=n.md.algorithms[i].create()}else e=i;if(null===o)o=t;else{if("string"==typeof o)o=n.util.createBuffer(o);else if(n.util.isArray(o)){var s=o;o=n.util.createBuffer();for(var h=0;h<s.length;++h)o.putByte(s[h])}var u=o.length();u>e.blockLength&&(e.start(),e.update(o.bytes()),o=e.digest()),r=n.util.createBuffer(),a=n.util.createBuffer(),u=o.length();for(var h=0;h<u;++h){var s=o.at(h);r.putByte(54^s),a.putByte(92^s)}if(u<e.blockLength)for(var s=e.blockLength-u,h=0;h<s;++h)r.putByte(54),a.putByte(92);t=o,r=r.bytes(),a=a.bytes()}e.start(),e.update(r)},i.update=function(t){e.update(t)},i.getMac=function(){var t=e.digest().bytes();return e.start(),e.update(a),e.update(t),e.digest()},i.digest=i.getMac,i}},function(t,e,r){t.exports=r(1),r(6),r(7),r(8),r(9)},function(t,e,r){function n(){s=String.fromCharCode(128),s+=i.util.fillString(String.fromCharCode(0),64),h=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],u=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],f=new Array(64);for(var t=0;t<64;++t)f[t]=Math.floor(4294967296*Math.abs(Math.sin(t+1)));l=!0}function a(t,e,r){for(var n,a,i,o,s,l,g,c,d=r.length();d>=64;){for(a=t.h0,i=t.h1,o=t.h2,s=t.h3,c=0;c<16;++c)e[c]=r.getInt32Le(),l=s^i&(o^s),n=a+l+f[c]+e[c],g=u[c],a=s,s=o,o=i,i+=n<<g|n>>>32-g;for(;c<32;++c)l=o^s&(i^o),n=a+l+f[c]+e[h[c]],g=u[c],a=s,s=o,o=i,i+=n<<g|n>>>32-g;for(;c<48;++c)l=i^o^s,n=a+l+f[c]+e[h[c]],g=u[c],a=s,s=o,o=i,i+=n<<g|n>>>32-g;for(;c<64;++c)l=o^(i|~s),n=a+l+f[c]+e[h[c]],g=u[c],a=s,s=o,o=i,i+=n<<g|n>>>32-g;t.h0=t.h0+a|0,t.h1=t.h1+i|0,t.h2=t.h2+o|0,t.h3=t.h3+s|0,d-=64}}var i=r(0);r(1),r(2);var o=t.exports=i.md5=i.md5||{};i.md.md5=i.md.algorithms.md5=o,o.create=function(){l||n();var t=null,e=i.util.createBuffer(),r=new Array(16),o={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return o.start=function(){o.messageLength=0,o.fullMessageLength=o.messageLength64=[];for(var r=o.messageLengthSize/4,n=0;n<r;++n)o.fullMessageLength.push(0);return e=i.util.createBuffer(),t={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},o},o.start(),o.update=function(n,s){"utf8"===s&&(n=i.util.encodeUtf8(n));var h=n.length;o.messageLength+=h,h=[h/4294967296>>>0,h>>>0];for(var u=o.fullMessageLength.length-1;u>=0;--u)o.fullMessageLength[u]+=h[1],h[1]=h[0]+(o.fullMessageLength[u]/4294967296>>>0),o.fullMessageLength[u]=o.fullMessageLength[u]>>>0,h[0]=h[1]/4294967296>>>0;return e.putBytes(n),a(t,r,e),(e.read>2048||0===e.length())&&e.compact(),o},o.digest=function(){var n=i.util.createBuffer();n.putBytes(e.bytes());var h=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize,u=h&o.blockLength-1;n.putBytes(s.substr(0,o.blockLength-u));for(var f,l=0,g=o.fullMessageLength.length-1;g>=0;--g)f=8*o.fullMessageLength[g]+l,l=f/4294967296>>>0,n.putInt32Le(f>>>0);var c={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3};a(c,r,n);var d=i.util.createBuffer();return d.putInt32Le(c.h0),d.putInt32Le(c.h1),d.putInt32Le(c.h2),d.putInt32Le(c.h3),d},o};var s=null,h=null,u=null,f=null,l=!1},function(t,e,r){function n(){s=String.fromCharCode(128),s+=i.util.fillString(String.fromCharCode(0),64),h=!0}function a(t,e,r){for(var n,a,i,o,s,h,u,f,l=r.length();l>=64;){for(a=t.h0,i=t.h1,o=t.h2,s=t.h3,h=t.h4,f=0;f<16;++f)n=r.getInt32(),e[f]=n,u=s^i&(o^s),n=(a<<5|a>>>27)+u+h+1518500249+n,h=s,s=o,o=(i<<30|i>>>2)>>>0,i=a,a=n;for(;f<20;++f)n=e[f-3]^e[f-8]^e[f-14]^e[f-16],n=n<<1|n>>>31,e[f]=n,u=s^i&(o^s),n=(a<<5|a>>>27)+u+h+1518500249+n,h=s,s=o,o=(i<<30|i>>>2)>>>0,i=a,a=n;for(;f<32;++f)n=e[f-3]^e[f-8]^e[f-14]^e[f-16],n=n<<1|n>>>31,e[f]=n,u=i^o^s,n=(a<<5|a>>>27)+u+h+1859775393+n,h=s,s=o,o=(i<<30|i>>>2)>>>0,i=a,a=n;for(;f<40;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,u=i^o^s,n=(a<<5|a>>>27)+u+h+1859775393+n,h=s,s=o,o=(i<<30|i>>>2)>>>0,i=a,a=n;for(;f<60;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,u=i&o|s&(i^o),n=(a<<5|a>>>27)+u+h+2400959708+n,h=s,s=o,o=(i<<30|i>>>2)>>>0,i=a,a=n;for(;f<80;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,u=i^o^s,n=(a<<5|a>>>27)+u+h+3395469782+n,h=s,s=o,o=(i<<30|i>>>2)>>>0,i=a,a=n;t.h0=t.h0+a|0,t.h1=t.h1+i|0,t.h2=t.h2+o|0,t.h3=t.h3+s|0,t.h4=t.h4+h|0,l-=64}}var i=r(0);r(1),r(2);var o=t.exports=i.sha1=i.sha1||{};i.md.sha1=i.md.algorithms.sha1=o,o.create=function(){h||n();var t=null,e=i.util.createBuffer(),r=new Array(80),o={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return o.start=function(){o.messageLength=0,o.fullMessageLength=o.messageLength64=[];for(var r=o.messageLengthSize/4,n=0;n<r;++n)o.fullMessageLength.push(0);return e=i.util.createBuffer(),t={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},o},o.start(),o.update=function(n,s){"utf8"===s&&(n=i.util.encodeUtf8(n));var h=n.length;o.messageLength+=h,h=[h/4294967296>>>0,h>>>0];for(var u=o.fullMessageLength.length-1;u>=0;--u)o.fullMessageLength[u]+=h[1],h[1]=h[0]+(o.fullMessageLength[u]/4294967296>>>0),o.fullMessageLength[u]=o.fullMessageLength[u]>>>0,h[0]=h[1]/4294967296>>>0;return e.putBytes(n),a(t,r,e),(e.read>2048||0===e.length())&&e.compact(),o},o.digest=function(){var n=i.util.createBuffer();n.putBytes(e.bytes());var h=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize,u=h&o.blockLength-1;n.putBytes(s.substr(0,o.blockLength-u));for(var f,l,g=8*o.fullMessageLength[0],c=0;c<o.fullMessageLength.length-1;++c)f=8*o.fullMessageLength[c+1],l=f/4294967296>>>0,g+=l,n.putInt32(g>>>0),g=f>>>0;n.putInt32(g);var d={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};a(d,r,n);var p=i.util.createBuffer();return p.putInt32(d.h0),p.putInt32(d.h1),p.putInt32(d.h2),p.putInt32(d.h3),p.putInt32(d.h4),p},o};var s=null,h=!1},function(t,e,r){function n(){s=String.fromCharCode(128),s+=i.util.fillString(String.fromCharCode(0),64),u=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],h=!0}function a(t,e,r){for(var n,a,i,o,s,h,f,l,g,c,d,p,y,m,v,B=r.length();B>=64;){for(f=0;f<16;++f)e[f]=r.getInt32();for(;f<64;++f)n=e[f-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,a=e[f-15],a=(a>>>7|a<<25)^(a>>>18|a<<14)^a>>>3,e[f]=n+e[f-7]+a+e[f-16]|0;for(l=t.h0,g=t.h1,c=t.h2,d=t.h3,p=t.h4,y=t.h5,m=t.h6,v=t.h7,f=0;f<64;++f)o=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7),s=m^p&(y^m),i=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),h=l&g|c&(l^g),n=v+o+s+u[f]+e[f],a=i+h,v=m,m=y,y=p,p=d+n>>>0,d=c,c=g,g=l,l=n+a>>>0;t.h0=t.h0+l|0,t.h1=t.h1+g|0,t.h2=t.h2+c|0,t.h3=t.h3+d|0,t.h4=t.h4+p|0,t.h5=t.h5+y|0,t.h6=t.h6+m|0,t.h7=t.h7+v|0,B-=64}}var i=r(0);r(1),r(2);var o=t.exports=i.sha256=i.sha256||{};i.md.sha256=i.md.algorithms.sha256=o,o.create=function(){h||n();var t=null,e=i.util.createBuffer(),r=new Array(64),o={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return o.start=function(){o.messageLength=0,o.fullMessageLength=o.messageLength64=[];for(var r=o.messageLengthSize/4,n=0;n<r;++n)o.fullMessageLength.push(0);return e=i.util.createBuffer(),t={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},o},o.start(),o.update=function(n,s){"utf8"===s&&(n=i.util.encodeUtf8(n));var h=n.length;o.messageLength+=h,h=[h/4294967296>>>0,h>>>0];for(var u=o.fullMessageLength.length-1;u>=0;--u)o.fullMessageLength[u]+=h[1],h[1]=h[0]+(o.fullMessageLength[u]/4294967296>>>0),o.fullMessageLength[u]=o.fullMessageLength[u]>>>0,h[0]=h[1]/4294967296>>>0;return e.putBytes(n),a(t,r,e),(e.read>2048||0===e.length())&&e.compact(),o},o.digest=function(){var n=i.util.createBuffer();n.putBytes(e.bytes());var h=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize,u=h&o.blockLength-1;n.putBytes(s.substr(0,o.blockLength-u));for(var f,l,g=8*o.fullMessageLength[0],c=0;c<o.fullMessageLength.length-1;++c)f=8*o.fullMessageLength[c+1],l=f/4294967296>>>0,g+=l,n.putInt32(g>>>0),g=f>>>0;n.putInt32(g);var d={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};a(d,r,n);var p=i.util.createBuffer();return p.putInt32(d.h0),p.putInt32(d.h1),p.putInt32(d.h2),p.putInt32(d.h3),p.putInt32(d.h4),p.putInt32(d.h5),p.putInt32(d.h6),p.putInt32(d.h7),p},o};var s=null,h=!1,u=null},function(t,e,r){function n(){h=String.fromCharCode(128),h+=i.util.fillString(String.fromCharCode(0),128),f=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],l={},l["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],l["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],l["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],l["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],u=!0}function a(t,e,r){for(var n,a,i,o,s,h,u,l,g,c,d,p,y,m,v,B,b,w,S,L,C,I,A,M,x,D,U,k,O,j,H,z,E,N,P,T=r.length();T>=128;){for(O=0;O<16;++O)e[O][0]=r.getInt32()>>>0,e[O][1]=r.getInt32()>>>0;for(;O<80;++O)z=e[O-2],j=z[0],H=z[1],n=((j>>>19|H<<13)^(H>>>29|j<<3)^j>>>6)>>>0,a=((j<<13|H>>>19)^(H<<3|j>>>29)^(j<<26|H>>>6))>>>0,N=e[O-15],j=N[0],H=N[1],i=((j>>>1|H<<31)^(j>>>8|H<<24)^j>>>7)>>>0,o=((j<<31|H>>>1)^(j<<24|H>>>8)^(j<<25|H>>>7))>>>0,E=e[O-7],P=e[O-16],H=a+E[1]+o+P[1],e[O][0]=n+E[0]+i+P[0]+(H/4294967296>>>0)>>>0,e[O][1]=H>>>0;for(y=t[0][0],m=t[0][1],v=t[1][0],B=t[1][1],b=t[2][0],w=t[2][1],S=t[3][0],L=t[3][1],C=t[4][0],I=t[4][1],A=t[5][0],M=t[5][1],x=t[6][0],D=t[6][1],U=t[7][0],k=t[7][1],O=0;O<80;++O)u=((C>>>14|I<<18)^(C>>>18|I<<14)^(I>>>9|C<<23))>>>0,l=((C<<18|I>>>14)^(C<<14|I>>>18)^(I<<23|C>>>9))>>>0,g=(x^C&(A^x))>>>0,c=(D^I&(M^D))>>>0,s=((y>>>28|m<<4)^(m>>>2|y<<30)^(m>>>7|y<<25))>>>0,h=((y<<4|m>>>28)^(m<<30|y>>>2)^(m<<25|y>>>7))>>>0,d=(y&v|b&(y^v))>>>0,p=(m&B|w&(m^B))>>>0,H=k+l+c+f[O][1]+e[O][1],n=U+u+g+f[O][0]+e[O][0]+(H/4294967296>>>0)>>>0,a=H>>>0,H=h+p,i=s+d+(H/4294967296>>>0)>>>0,o=H>>>0,U=x,k=D,x=A,D=M,A=C,M=I,H=L+a,C=S+n+(H/4294967296>>>0)>>>0,I=H>>>0,S=b,L=w,b=v,w=B,v=y,B=m,H=a+o,y=n+i+(H/4294967296>>>0)>>>0,m=H>>>0;H=t[0][1]+m,t[0][0]=t[0][0]+y+(H/4294967296>>>0)>>>0,t[0][1]=H>>>0,H=t[1][1]+B,t[1][0]=t[1][0]+v+(H/4294967296>>>0)>>>0,t[1][1]=H>>>0,H=t[2][1]+w,t[2][0]=t[2][0]+b+(H/4294967296>>>0)>>>0,t[2][1]=H>>>0,H=t[3][1]+L,t[3][0]=t[3][0]+S+(H/4294967296>>>0)>>>0,t[3][1]=H>>>0,H=t[4][1]+I,t[4][0]=t[4][0]+C+(H/4294967296>>>0)>>>0,t[4][1]=H>>>0,H=t[5][1]+M,t[5][0]=t[5][0]+A+(H/4294967296>>>0)>>>0,t[5][1]=H>>>0,H=t[6][1]+D,t[6][0]=t[6][0]+x+(H/4294967296>>>0)>>>0,t[6][1]=H>>>0,H=t[7][1]+k,t[7][0]=t[7][0]+U+(H/4294967296>>>0)>>>0,t[7][1]=H>>>0,T-=128}}var i=r(0);r(1),r(2);var o=t.exports=i.sha512=i.sha512||{};i.md.sha512=i.md.algorithms.sha512=o;var s=i.sha384=i.sha512.sha384=i.sha512.sha384||{};s.create=function(){return o.create("SHA-384")},i.md.sha384=i.md.algorithms.sha384=s,i.sha512.sha256=i.sha512.sha256||{create:function(){return o.create("SHA-512/256")}},i.md["sha512/256"]=i.md.algorithms["sha512/256"]=i.sha512.sha256,i.sha512.sha224=i.sha512.sha224||{create:function(){return o.create("SHA-512/224")}},i.md["sha512/224"]=i.md.algorithms["sha512/224"]=i.sha512.sha224,o.create=function(t){if(u||n(),void 0===t&&(t="SHA-512"),!(t in l))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=l[t],r=null,o=i.util.createBuffer(),s=new Array(80),f=0;f<80;++f)s[f]=new Array(2);var g=64;switch(t){case"SHA-384":g=48;break;case"SHA-512/256":g=32;break;case"SHA-512/224":g=28}var c={algorithm:t.replace("-","").toLowerCase(),blockLength:128,digestLength:g,messageLength:0,fullMessageLength:null,messageLengthSize:16};return c.start=function(){c.messageLength=0,c.fullMessageLength=c.messageLength128=[];for(var t=c.messageLengthSize/4,n=0;n<t;++n)c.fullMessageLength.push(0);o=i.util.createBuffer(),r=new Array(e.length);for(var n=0;n<e.length;++n)r[n]=e[n].slice(0);return c},c.start(),c.update=function(t,e){"utf8"===e&&(t=i.util.encodeUtf8(t));var n=t.length;c.messageLength+=n,n=[n/4294967296>>>0,n>>>0];for(var h=c.fullMessageLength.length-1;h>=0;--h)c.fullMessageLength[h]+=n[1],n[1]=n[0]+(c.fullMessageLength[h]/4294967296>>>0),c.fullMessageLength[h]=c.fullMessageLength[h]>>>0,n[0]=n[1]/4294967296>>>0;return o.putBytes(t),a(r,s,o),(o.read>2048||0===o.length())&&o.compact(),c},c.digest=function(){var e=i.util.createBuffer();e.putBytes(o.bytes());var n=c.fullMessageLength[c.fullMessageLength.length-1]+c.messageLengthSize,u=n&c.blockLength-1;e.putBytes(h.substr(0,c.blockLength-u));for(var f,l,g=8*c.fullMessageLength[0],d=0;d<c.fullMessageLength.length-1;++d)f=8*c.fullMessageLength[d+1],l=f/4294967296>>>0,g+=l,e.putInt32(g>>>0),g=f>>>0;e.putInt32(g);for(var p=new Array(r.length),d=0;d<r.length;++d)p[d]=r[d].slice(0);a(p,s,e);var y,m=i.util.createBuffer();y="SHA-512"===t?p.length:"SHA-384"===t?p.length-2:p.length-4;for(var d=0;d<y;++d)m.putInt32(p[d][0]),d===y-1&&"SHA-512/224"===t||m.putInt32(p[d][1]);return m},c};var h=null,u=!1,f=null,l=null},function(t,e,r){t.exports=r(3)}])}); //# sourceMappingURL=forge.hash.min.js.map