filer/dist/buffer.min.js

2 lines
17 KiB
JavaScript
Raw Normal View History

/*! filer 0.0.41 2015-06-01 */
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.FilerBuffer=t()}}(function(){return function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);throw Error("Cannot find module '"+a+"'")}var f=n[a]={exports:{}};e[a][0].call(f.exports,function(t){var n=e[a][1][t];return i(n?n:t)},f,f.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;r.length>a;a++)i(r[a]);return i}({1:[function(t,e,n){function r(t,e,n){if(!(this instanceof r))return new r(t,e,n);var i,o=typeof t;if("number"===o)i=t>0?t>>>0:0;else if("string"===o)"base64"===e&&(t=A(t)),i=r.byteLength(t,e);else{if("object"!==o||null===t)throw new TypeError("must start with number, buffer, array or string");"Buffer"===t.type&&P(t.data)&&(t=t.data),i=+t.length>0?Math.floor(+t.length):0}if(this.length>M)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+M.toString(16)+" bytes");var a;r.TYPED_ARRAY_SUPPORT?a=r._augment(new Uint8Array(i)):(a=this,a.length=i,a._isBuffer=!0);var s;if(r.TYPED_ARRAY_SUPPORT&&"number"==typeof t.byteLength)a._set(t);else if(T(t))if(r.isBuffer(t))for(s=0;i>s;s++)a[s]=t.readUInt8(s);else for(s=0;i>s;s++)a[s]=(t[s]%256+256)%256;else if("string"===o)a.write(t,0,e);else if("number"===o&&!r.TYPED_ARRAY_SUPPORT&&!n)for(s=0;i>s;s++)a[s]=0;return a}function i(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var o=e.length;if(0!==o%2)throw Error("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;r>a;a++){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))throw Error("Invalid hex string");t[n+a]=s}return a}function o(t,e,n,r){var i=D(j(e),t,n,r);return i}function a(t,e,n,r){var i=D(S(e),t,n,r);return i}function s(t,e,n,r){return a(t,e,n,r)}function u(t,e,n,r){var i=D(x(e),t,n,r);return i}function f(t,e,n,r){var i=D(_(e),t,n,r,2);return i}function c(t,e,n){return 0===e&&n===t.length?N.fromByteArray(t):N.fromByteArray(t.slice(e,n))}function h(t,e,n){var r="",i="";n=Math.min(t.length,n);for(var o=e;n>o;o++)127>=t[o]?(r+=B(i)+String.fromCharCode(t[o]),i=""):i+="%"+t[o].toString(16);return r+B(i)}function l(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;n>i;i++)r+=String.fromCharCode(t[i]);return r}function p(t,e,n){return l(t,e,n)}function d(t,e,n){var r=t.length;(!e||0>e)&&(e=0),(!n||0>n||n>r)&&(n=r);for(var i="",o=e;n>o;o++)i+=R(t[o]);return i}function g(t,e,n){for(var r=t.slice(e,n),i="",o=0;r.length>o;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function v(t,e,n){if(0!==t%1||0>t)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function E(t,e,n,i,o,a){if(!r.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");if(e>o||a>e)throw new TypeError("value is out of bounds");if(n+i>t.length)throw new TypeError("index out of range")}function m(t,e,n,r){0>e&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);o>i;i++)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function y(t,e,n,r){0>e&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);o>i;i++)t[n+i]=255&e>>>8*(r?i:3-i)}function w(t,e,n,r,i,o){if(e>i||o>e)throw new TypeError("value is out of bounds");if(n+r>t.length)throw new TypeError("index out of range")}function b(t,e,n,r,i){return i||w(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),L.write(t,e,n,r,23,4),n+4}function I(t,e,n,r,i){return i||w(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),L.write(t,e,n,r,52,8),n+8}function A(t){for(t=O(t).replace(C,"");0!==t.length%4;)t+="=";return t}function O(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function T(t){return P(t)||r.isBuffer(t)||t&&"object"==typeof t&&"number"==typeof t.length}function R(t){return 16>t?"0"+t.toString(16):t.toString(16)}function j(t){for(var e=[],n=0;t.length>n;n++){var r=t.charCodeAt(n);if(127>=r)e.push(r);else{va