filer/dist/buffer.min.js

2 lines
20 KiB
JavaScript
Raw Normal View History

/*! filer 0.0.44 2017-05-25 */
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.FilerBuffer=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){function d(a){return this instanceof d?(this.length=0,this.parent=void 0,"number"==typeof a?e(this,a):"string"==typeof a?f(this,a,arguments.length>1?arguments[1]:"utf8"):g(this,a)):arguments.length>1?new d(a,arguments[1]):new d(a)}function e(a,b){if(a=m(a,0>b?0:0|n(b)),!d.TYPED_ARRAY_SUPPORT)for(var c=0;b>c;c++)a[c]=0;return a}function f(a,b,c){("string"!=typeof c||""===c)&&(c="utf8");var d=0|p(b,c);return a=m(a,d),a.write(b,c),a}function g(a,b){if(d.isBuffer(b))return h(a,b);if(U(b))return i(a,b);if(null==b)throw new TypeError("must start with number, buffer, array or string");return"undefined"!=typeof ArrayBuffer&&b.buffer instanceof ArrayBuffer?j(a,b):b.length?k(a,b):l(a,b)}function h(a,b){var c=0|n(b.length);return a=m(a,c),b.copy(a,0,0,c),a}function i(a,b){var c=0|n(b.length);a=m(a,c);for(var d=0;c>d;d+=1)a[d]=255&b[d];return a}function j(a,b){var c=0|n(b.length);a=m(a,c);for(var d=0;c>d;d+=1)a[d]=255&b[d];return a}function k(a,b){var c=0|n(b.length);a=m(a,c);for(var d=0;c>d;d+=1)a[d]=255&b[d];return a}function l(a,b){var c,d=0;"Buffer"===b.type&&U(b.data)&&(c=b.data,d=0|n(c.length)),a=m(a,d);for(var e=0;d>e;e+=1)a[e]=255&c[e];return a}function m(a,b){d.TYPED_ARRAY_SUPPORT?a=d._augment(new Uint8Array(b)):(a.length=b,a._isBuffer=!0);var c=0!==b&&b<=d.poolSize>>>1;return c&&(a.parent=W),a}function n(a){if(a>=V)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+V.toString(16)+" bytes");return 0|a}function o(a,b){if(!(this instanceof o))return new o(a,b);var c=new d(a,b);return delete c.parent,c}function p(a,b){if("string"!=typeof a&&(a=String(a)),0===a.length)return 0;switch(b||"utf8"){case"ascii":case"binary":case"raw":return a.length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*a.length;case"hex":return a.length>>>1;case"utf8":case"utf-8":return M(a).length;case"base64":return P(a).length;default:return a.length}}function q(a,b,c,d){c=Number(c)||0;var e=a.length-c;d?(d=Number(d),d>e&&(d=e)):d=e;var f=b.length;if(f%2!==0)throw new Error("Invalid hex string");d>f/2&&(d=f/2);for(var g=0;d>g;g++){var h=parseInt(b.substr(2*g,2),16);if(isNaN(h))throw new Error("Invalid hex string");a[c+g]=h}return g}function r(a,b,c,d){return Q(M(b,a.length-c),a,c,d)}function s(a,b,c,d){return Q(N(b),a,c,d)}function t(a,b,c,d){return s(a,b,c,d)}function u(a,b,c,d){return Q(P(b),a,c,d)}function v(a,b,c,d){return Q(O(b,a.length-c),a,c,d)}function w(a,b,c){return 0===b&&c===a.length?S.fromByteArray(a):S.fromByteArray(a.slice(b,c))}function x(a,b,c){var d="",e="";c=Math.min(a.length,c);for(var f=b;c>f;f++)a[f]<=127?(d+=R(e)+String.fromCharCode(a[f]),e=""):e+="%"+a[f].toString(16);return d+R(e)}function y(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;c>e;e++)d+=String.fromCharCode(127&a[e]);return d}function z(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;c>e;e++)d+=String.fromCharCode(a[e]);return d}function A(a,b,c){var d=a.length;(!b||0>b)&&(b=0),(!c||0>c||c>d)&&(c=d);for(var e="",f=b;c>f;f++)e+=L(a[f]);return e}function B(a,b,c){for(var d=a.slice(b,c),e="",f=0;f<d.length;f+=2)e+=String.fromCharCode(d[f]+256*d[f+1]);return e}function C(a,b,c){if(a%1!==0||0>a)throw new RangeError("offset is not uint");if(a+b>c)throw new RangeError("Trying to access beyond buffer length")}function D(a,b,c,e,f,g){if(!d.isBuffer(a))throw new TypeError("buffer must