filer/dist/buffer.min.js

2 lines
21 KiB
JavaScript
Raw Normal View History

2015-07-21 18:40:33 +00:00
/*! filer 0.0.43 2015-07-21 */
!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(){return e.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function e(a){return this instanceof e?(this.length=0,this.parent=void 0,"number"==typeof a?f(this,a):"string"==typeof a?g(this,a,arguments.length>1?arguments[1]:"utf8"):h(this,a)):arguments.length>1?new e(a,arguments[1]):new e(a)}function f(a,b){if(a=n(a,0>b?0:0|o(b)),!e.TYPED_ARRAY_SUPPORT)for(var c=0;b>c;c++)a[c]=0;return a}function g(a,b,c){("string"!=typeof c||""===c)&&(c="utf8");var d=0|q(b,c);return a=n(a,d),a.write(b,c),a}function h(a,b){if(e.isBuffer(b))return i(a,b);if(W(b))return j(a,b);if(null==b)throw new TypeError("must start with number, buffer, array or string");return"undefined"!=typeof ArrayBuffer&&b.buffer instanceof ArrayBuffer?k(a,b):b.length?l(a,b):m(a,b)}function i(a,b){var c=0|o(b.length);return a=n(a,c),b.copy(a,0,0,c),a}function j(a,b){var c=0|o(b.length);a=n(a,c);for(var d=0;c>d;d+=1)a[d]=255&b[d];return a}function k(a,b){var c=0|o(b.length);a=n(a,c);for(var d=0;c>d;d+=1)a[d]=255&b[d];return a}function l(a,b){var c=0|o(b.length);a=n(a,c);for(var d=0;c>d;d+=1)a[d]=255&b[d];return a}function m(a,b){var c,d=0;"Buffer"===b.type&&W(b.data)&&(c=b.data,d=0|o(c.length)),a=n(a,d);for(var e=0;d>e;e+=1)a[e]=255&c[e];return a}function n(a,b){e.TYPED_ARRAY_SUPPORT?a=e._augment(new Uint8Array(b)):(a.length=b,a._isBuffer=!0);var c=0!==b&&b<=e.poolSize>>>1;return c&&(a.parent=X),a}function o(a){if(a>=d())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+d().toString(16)+" bytes");return 0|a}function p(a,b){if(!(this instanceof p))return new p(a,b);var c=new e(a,b);return delete c.parent,c}function q(a,b){"string"!=typeof a&&(a=""+a);var c=a.length;if(0===c)return 0;for(var d=!1;;)switch(b){case"ascii":case"binary":case"raw":case"raws":return c;case"utf8":case"utf-8":return O(a).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*c;case"hex":return c>>>1;case"base64":return R(a).length;default:if(d)return O(a).length;b=(""+b).toLowerCase(),d=!0}}function r(a,b,c){var d=!1;if(b=0|b,c=void 0===c||c===1/0?this.length:0|c,a||(a="utf8"),0>b&&(b=0),c>this.length&&(c=this.length),b>=c)return"";for(;;)switch(a){case"hex":return C(this,b,c);case"utf8":case"utf-8":return z(this,b,c);case"ascii":return A(this,b,c);case"binary":return B(this,b,c);case"base64":return y(this,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,b,c);default:if(d)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),d=!0}}function s(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 t(a,b,c,d){return S(O(b,a.length-c),a,c,d)}function u(a,b,c,d){return S(P(b),a,c,d)}function v(a,b,c,d){return u(a,b,c,d)}function w(a,b,c,d){return S(R(b),a,c,d)}function x(a,b,c,d){return S(Q(b,a.length-c),a,c,d)}function y(a,b,c){return 0===b&&c===a.length?U.fromByteArray(a):U.fromByteArray(a.slice(b,c))}function z(a,b,c){var d="",e="";c=Math.min(a.length,c);for(var f=b;c>f;f++)a[f]<=127?(d+=T(e)+String.fromCharCode(a[f]),e=""):e+="%"+a[f].toString(16);return d+T(e)}function A(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;c>e;e++)d+=String.fromCha