| 1 |
- var Uint64BE,Int64BE,Uint64LE,Int64LE;!function(E){var g,A="undefined",U=A!==typeof Buffer&&Buffer,I=A!==typeof Uint8Array&&Uint8Array,L=A!==typeof ArrayBuffer&&ArrayBuffer,d=[0,0,0,0,0,0,0,0],n=Array.isArray||function(t){return!!t&&"[object Array]"==Object.prototype.toString.call(t)},w=4294967296;function t(t,r,a){var c=r?0:4,y=r?4:0,n=r?0:3,e=r?1:2,o=r?2:1,i=r?3:0,u=r?k:J,s=r?O:_,f=l.prototype,h="is"+t,v="_"+h;return f.buffer=void 0,f.offset=0,f[v]=!0,f.toNumber=p,f.toString=function(t){var r=this.buffer,f=this.offset,n=B(r,f+c),e=B(r,f+y),o="",i=!a&&2147483648&n;i&&(n=~n,e=w-e);t=t||10;for(;;){var u=n%t*w+e;if(n=Math.floor(n/t),e=Math.floor(u/t),o=(u%t).toString(t)+o,!n&&!e)break}i&&(o="-"+o);return o},f.toJSON=p,f.toArray=m,U&&(f.toBuffer=S),I&&(f.toArrayBuffer=j),l[h]=function(t){return!(!t||!t[v])},E[t]=l;function l(t,r,f,n){return this instanceof l?function(t,r,f,n,e){I&&L&&(r instanceof L&&(r=new I(r)),n instanceof L&&(n=new I(n)));if(!(r||f||n||g))return void(t.buffer=N(d,0));if(!x(r,f)){var o=g||Array;e=f,n=r,f=0,r=new o(8)}if(t.buffer=r,t.offset=f|=0,A===typeof n)return;"string"==typeof n?function(t,r,f,n){var e=0,o=f.length,i=0,u=0;"-"===f[0]&&e++;var a=e;for(;e<o;){var s=parseInt(f[e++],n);if(!(0<=s))break;u=u*n+s,i=i*n+Math.floor(u/w),u%=w}a&&(i=~i,u?u=w-u:i++);b(t,r+c,i),b(t,r+y,u)}(r,f,n,e||10):x(n,e)?M(r,f,n,e):"number"==typeof e?(b(r,f+c,n),b(r,f+y,e)):0<n?u(r,f,n):n<0?s(r,f,n):M(r,f,d,0)}(this,t,r,f,n):new l(t,r,f,n)}function p(){var t=this.buffer,r=this.offset,f=B(t,r+c),n=B(t,r+y);return a||(f|=0),f?f*w+n:n}function b(t,r,f){t[r+i]=255&f,f>>=8,t[r+o]=255&f,f>>=8,t[r+e]=255&f,f>>=8,t[r+n]=255&f}function B(t,r){return 16777216*t[r+n]+(t[r+e]<<16)+(t[r+o]<<8)+t[r+i]}}function m(t){var r=this.buffer,f=this.offset;return g=null,!1!==t&&n(r)?8===r.length?r:r.slice(f,f+8):N(r,f)}function S(t){var r=this.buffer,f=this.offset;return g=U,!1!==t&&U.isBuffer(r)?8===r.length?r:r.slice(f,f+8):U.from(j.call(this,t))}function j(t){var r=this.buffer,f=this.offset,n=r.buffer;if(g=I,!1!==t&&!r.offset&&n instanceof L)return 8===n.byteLength?n:n.slice(f,f+8);var e=new I(8);return M(e,0,r,f),e.buffer}function x(t,r){var f=t&&t.length;return r|=0,f&&r+8<=f&&"string"!=typeof t[r]}function M(t,r,f,n){r|=0,n|=0;for(var e=0;e<8;e++)t[r++]=255&f[n++]}function N(t,r){return Array.prototype.slice.call(t,r,r+8)}function k(t,r,f){for(var n=r+8;r<n;)t[--n]=255&f,f/=256}function O(t,r,f){var n=r+8;for(f++;r<n;)t[--n]=255&-f^255,f/=256}function J(t,r,f){for(var n=r+8;r<n;)t[r++]=255&f,f/=256}function _(t,r,f){var n=r+8;for(f++;r<n;)t[r++]=255&-f^255,f/=256}Uint64BE=t("Uint64BE",!0,!0),Int64BE=t("Int64BE",!0,!1),Uint64LE=t("Uint64LE",!1,!0),Int64LE=t("Int64LE",!1,!1)}("object"==typeof exports&&"string"!=typeof exports.nodeName?exports:this||{});
|