arnaucube
arnaucube/websnarkPublic Self-hosted repository
websnark/example/websnark.js
example/websnark.jsRaw
   1(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
   2(function (Buffer){
   3
   4            exports.code = new Buffer("AGFzbQEAAAABPApgAn9/AGABfwBgAX8Bf2ACf38Bf2ADf39/AX9gA39/fwBgA39+fwBgAn9+AGAEf39/fwBgBX9/f39/AAIQAQNlbnYGbWVtb3J5AgDoBwNoZwABAgEDAwQEBQYHCAUFBQAABQAAAAEFBQAABQAAAAEFAAIBAAAFAAUAAAAIAQIAAgUICQgABQkDAAUFBQUAAgUFCAAIAgEBAAUFBQAAAAMAAgEAAAUABQAAAAgBAgACBQgJCAAFCQUHjAleCGludF9jb3B5AAAIaW50X3plcm8AAQdpbnRfb25lAAMKaW50X2lzWmVybwACBmludF9lcQAEB2ludF9ndGUABQdpbnRfYWRkAAYHaW50X3N1YgAHB2ludF9tdWwACAdpbnRfZGl2AAsOaW50X2ludmVyc2VNb2QADAdmMW1fYWRkAA0HZjFtX3N1YgAOB2YxbV9uZWcADwtmMW1fbVJlZHVjdAAQB2YxbV9tdWwAERJmMW1fZnJvbU1vbnRnb21lcnkAExBmMW1fdG9Nb250Z29tZXJ5ABILZjFtX2ludmVyc2UAFAhmMW1fY29weQAACGYxbV96ZXJvAAEKZjFtX2lzWmVybwACBmYxbV9lcQAEB2YxbV9vbmUAFQdmcm1fYWRkABYHZnJtX3N1YgAXB2ZybV9uZWcAGAtmcm1fbVJlZHVjdAAZB2ZybV9tdWwAGhJmcm1fZnJvbU1vbnRnb21l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AgASAAKQMANwMAIAEgACkDCDcDCCABIAApAxA3AxAgASAAKQMYNwMYCx4AIABCADcDACAAQgA3AwggAEIANwMQIABCADcDGAszACAAKQMYUARAIAApAxBQBEAgACkDCFAEQCAAKQMAUA8FQQAPCwVBAA8LBUEADwtBAA8LHgAgAEIBNwMAIABCADcDCCAAQgA3AxAgAEIANwMYC0cAIAApAxggASkDGFEEQCAAKQMQIAEpAxBRBEAgACkDCCABKQMIUQRAIAApAwAgASkDAFEPBUEADwsFQQAPCwVBAA8LQQAPC30AIAApAxggASkDGFQEQEEADwUgACkDGCABKQMYVgRAQQEPBSAAKQMQIAEpAxBUBEBBAA8FIAApAxAgASkDEFYEQEEBDwUgACkDCCABKQMIVARAQQAPBSAAKQMIIAEpAwhWBEBBAQ8FIAApAwAgASkDAFoPCwsLCwsLQQAPC9QBAQF+IAA1AgAgATUCAHwhAyACIAM+AgAgADUCBCABNQIEfCADQiCIfCEDIAIgAz4CBCAANQIIIAE1Agh8IANCIIh8IQMgAiADPgIIIAA1AgwgATUCDHwgA0IgiHwhAyACIAM+AgwgADUCECABNQIQfCADQiCIfCEDIAIgAz4CECAANQIUIAE1AhR8IANCIIh8IQMgAiADPgIUIAA1AhggATUCGHwgA0IgiHwhAyACIAM+AhggADUCHCABNQIcfCADQiCIfCEDIAIgAz4CHCADQiCIpwuMAgEBfiAANQIAIAE1AgB9IQMgAiADQv////8Pgz4CACAANQIEIAE1AgR9IANCIId8IQMgAiADQv////8Pgz4CBCAANQIIIAE1Agh9IANCIId8IQMgAiADQv////8Pgz4CCCAANQIMIAE1Agx9IANCIId8IQMgAiADQv////8Pgz4CDCAANQIQIAE1AhB9IANCIId8IQMgAiADQv////8Pgz4CECAANQIUIAE1AhR9IANCIId8IQMgAiADQv////8Pgz4CFCAANQIYIAE1Ahh9IANCIId8IQMgAiADQv////8Pgz4CGCAANQIcIAE1Ahx9IANCIId8IQMgAiADQv////8Pgz4CHCADQiCHpwv0EAEBfkEoIAA1AgAgATUCAH43AwBBKCAANQIAIAE1AgR+NwMIQSggADUCACABNQIIfjcDEEEoIAA1AgAgATUCDH43AxhBKCAANQIAIAE1AhB+NwMgQSggADUCACABNQIUfjcDKEEoIAA1AgAgATUCGH43AzBBKCAANQIAIAE1Ahx+NwM4QSggADUCBCABNQIAfjcDQEEoIAA1AgQgATUCBH43A0hBKCAANQIEIAE1Agh+NwNQQSggADUCBCABNQIMfjcDWEEoIAA1AgQgATUCEH43A2BBKCAANQIEIAE1AhR+NwNoQSggADUCBCABNQIYfjcDcEEoIAA1AgQgATUCHH43A3hBKCAANQIIIAE1AgB+NwOAAUEoIAA1AgggATUCBH43A4gBQSggADUCCCABNQIIfjcDkAFBKCAANQIIIAE1Agx+NwOYAUEoIAA1AgggATUCEH43A6ABQSggADUCCCABNQIUfjcDqAFBKCAANQIIIAE1Ahh+NwOwAUEoIAA1AgggATUCHH43A7gBQSggADUCDCABNQIAfjcDwAFBKCAANQIMIAE1AgR+NwPIAUEoIAA1AgwgATUCCH43A9ABQSggADUCDCABNQIMfjcD2AFBKCAANQIMIAE1AhB+NwPgAUEoIAA1AgwgATUCFH43A+gBQSggADUCDCABNQIYfjcD8AFBKCAANQIMIAE1Ahx+NwP4AUEoIAA1AhAgATUCAH43A4ACQSggADUCECABNQIEfjcDiAJBKCAANQIQIAE1Agh+NwOQAkEoIAA1AhAgATUCDH43A5gCQSggADUCECABNQIQfjcDoAJBKCAANQIQIAE1AhR+NwOoAkEoIAA1AhAgATUCGH43A7ACQSggADUCECABNQIcfjcDuAJBKCAANQIUIAE1AgB+NwPAAkEoIAA1AhQgATUCBH43A8gCQSggADUCFCABNQIIfjcD0AJBKCAANQIUIAE1Agx+NwPYAkEoIAA1AhQgATUCEH43A+ACQSggADUCFCABNQIUfjcD6AJBKCAANQIUIAE1Ahh+NwPwAkEoIAA1AhQgATUCHH43A/gCQSggADUCGCABNQIAfjcDgANBKCAANQIYIAE1AgR+NwOIA0EoIAA1AhggATUCCH43A5ADQSggADUCGCABNQIM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zUCFCAEfnwhAyAAIAM+AiwgADUCMCADQiCIfEHoBzUCGCAEfnwhAyAAIAM+AjAgADUCNCADQiCIfEHoBzUCHCAEfnwhAyAAIAM+AjRB6AggA0IgiD4CGEIAIQMgADUCHCACfkL/////D4MhBCAANQIcIANCIIh8QegHNQIAIAR+fCEDIAAgAz4CHCAANQIgIANCIIh8QegHNQIEIAR+fCEDIAAgAz4CICAANQIkIANCIIh8QegHNQIIIAR+fCEDIAAgAz4CJCAANQIoIANCIIh8QegHNQIMIAR+fCEDIAAgAz4CKCAANQIsIANCIIh8QegHNQIQIAR+fCEDIAAgAz4CLCAANQIwIANCIIh8QegHNQIUIAR+fCEDIAAgAz4CMCAANQI0IANCIIh8QegHNQIYIAR+fCEDIAAgAz4CNCAANQI4IANCIIh8QegHNQIcIAR+fCEDIAAgAz4COEHoCCADQiCIPgIcQegIIABBIGogARANCxIAIAAgAUHoDBAIQegMIAIQEAsLACAAQYgIIAEQEQsVACAAQagNEABByA0QAUGoDSABEBALFwAgACABEBMgAUHoByABEAwgASABEBILCQBBqAggABAACywAIAAgASACEAYEQCACQegNIAIQBxoFIAJB6A0QBQRAIAJB6A0gAhAHGgsLCxcAIAAgASACEAcEQCACQegNIAIQBhoLCxQAIAAQAkUEQEHoDSAAIAEQBxoLC5wRAwF+AX4BfkL/////DiECQgAhAyAANQIAIAJ+Qv////8PgyEEIAA1AgAgA0IgiHxB6A01AgAgBH58IQMgACADPgIAIAA1AgQgA0IgiHxB6A01AgQgBH58IQMgACADPgIEIAA1AgggA0IgiHxB6A01AgggBH58IQMgACADPgIIIAA1AgwgA0IgiHxB6A01AgwgBH58IQMgACADPgIMIAA1AhAgA0IgiHxB6A01AhAgBH58IQMgACADPgIQIAA1AhQgA0IgiHxB6A01AhQgBH58IQMgACADPgIUIAA1AhggA0IgiHxB6A01AhggBH58IQMgACADPgIYIAA1AhwgA0IgiHxB6A01AhwgBH58IQMgACADPgIcQegOIANCIIg+AgBCACEDIAA1AgQgAn5C/////w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FkGIGBAOQegXQcgXQagYEA5BiBhBiBhByBgQDUHIGEHIGEHIGBARQYgYQcgYQegYEBFBqBhBqBhBiBkQDUHIFkHIGEHIGRARQYgZQYgZQagZEBFByBlByBlB6BkQDUGoGUHoGCACEA4gAkHoGSACEA5ByBdB6BhBiBoQEUGIGkGIGkGIGhANQcgZIAIgAkEgahAOIAJBIGpBiBkgAkEgahARIAJBIGpBiBogAkEgahAOIAMgBCACQcAAahANIAJBwABqIAJBwABqIAJBwABqEBEgAkHAAGpBiBYgAkHAAGoQDiACQcAAakGoFiACQcAAahAOIAJBwABqQYgYIAJBwABqEBELIgAgACABEAAgAEEgaiABQSBqEA8gAEHAAGogAUHAAGoQAAsQACABIAIQJiAAIAIgAhAlCyIAIAAgARATIABBIGogAUEgahATIABBwABqIAFBwABqEBMLIgAgACABEBIgAEEgaiABQSBqEBIgAEHAAGogAUHAAGoQEgtPACAAECEEQCABECIFIABBwABqQagaEBRBqBpBqBpByBoQEUGoGkHIGkHoGhARIABByBogARARIABBIGpB6BogAUEgahARIAFBwABqEBULC6cCAgF/AX8gAEGIGxAjIAMQIiACIQQCQANAIARBAWshBCABIARqLQAAIQUgAyADECQgBUGAAU8EQCAFQYABayEFQYgbIAMgAxAlCyADIAMQJCAFQcAATwRAIAVBwABrIQVBiBsgAyADECULIAMgAxAkIAVBIE8EQCAFQSBrIQVBiBsgAyADECULIAMgAxAkIAVBEE8EQCAFQRBrIQVBiBsgAyADECULIAMgAxAkIAVBCE8EQCAFQQhrIQVBiBsgAyADECULIAMgAxAkIAVBBE8EQCAFQQRrIQVBiBsgAyADECULIAMgAxAkIAVBAk8EQCAFQQJrIQVBiBsgAyADECULIAMgAxAkIAVBAU8EQCAFQQFrIQVBiBsgAyADECULIARFDQEMAAsLCysCAX8BfyAAQQV2QQJ0IQFBASAAQR9xdCECIAEgASgC6NsBIAJyNgLo2wELJAIBfwF/IABBBXZBAnQhAUEBIABBH3F0IQIgASgC6NsBIAJxC6ABBAF/AX8BfwF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IIAQgCBAaC0MCAX8BfyAAQQF2IQJBACEBAkADQCACRQ0BIAJBAXYhAiABQQFqIQEMAAsLIABBASABdEcEQAALIAFBHEsEQAALIAELEgEBfyABED4hAyAAIAMgAhA5CxgBAX8gARA+IQMgACADIAIQOSAAIAMQPQtMBAF/AX8BfwF/IAAhBCABIQUgAyEGIAAgAkEgbGohBwJAA0AgBCAHRg0BIAQgBSAGEBogBEEgaiEEIAVBIGohBSAGQSBqIQYMAAsLCy4CAX8BfyAAIQMgACABQSBsaiECAkADQCADIAJGDQEgAxABIANBIGohAwwACwsLjgEGAX8BfwF/AX8BfwF/QQAhBCAAIQYgASEHAkADQCAEIAJGDQEgBigCACEJIAZBBGohBkEAIQUCQANAIAUgCUYNASADIAYoAgBBIGxqIQggBkEEaiEGIAcgBkGotwMQGkGotwMgCCAIEBYgBkEgaiEGIAVBAWohBQwACwsgB0EgaiEHIARBAWohBAwACwsLDgAgABACIABBIGoQAnELDQAgABABIABBIGoQAQsNACAAEBUgAEEgahABCxQAIAAgARAAIABBIGogAUEgahAAC3kAIAAgAUHotwMQESAAQSBqIAFBIGpBiLgDEBEgACAAQSBqQai4AxANIAEgAUEgakHIuAMQDUGouANByLgDQai4AxARQYi4A0HItwMgAhARQei3AyACIAIQDUHotwNBiLgDIAJBIGoQDUGouAMgAkEgaiACQSBqEA4LGwAgACABIAIQDSAAQSBqIAFBIGogAkEgahANCxsAIAAgASACEA4gAEEgaiABQSBqIAJBIGoQDgsUACAAIAEQDyAAQSBqIAFBIGoQDwsUACAAIAEQEiAAQSBqIAFBIGoQEgsUACAAIAEQEyAAQSBqIAFBIGoQEwsVACAAIAEQBCAAQSBqIAFBIGoQBHELaAAgACAAQei4AxARIABBIGogAEEgakGIuQMQEUGIuQNByLcDQai5AxARQei4A0GouQNBqLkDEA5BqLkDQci5AxAUIABByLkDIAEQESAAQSBqQci5AyABQSBqEBEgAUEgaiABQSBqEA8LCgAgAEGAAWoQRAsWACAAEEUgAEHAAGoQRiAAQYABahBFCyQAIAAgARBHIABBwABqIAFBwABqEEcgAEGAAWogAUGAAWoQRwu8AgAgABBQBEAgACABEFIPCyAAIABB6LkDEEggAEHAAGogAEHAAGpBqLoDEEhBqLoDQai6A0HougMQSCAAQai6A0GouwMQSUGouwNBqLsDQai7AxBIQai7A0HouQNBqLsDEEpBqLsDQei6A0GouwMQSkGouwNBqLsDQai7AxBJQei5A0HouQNB6LsDEElB6LsDQei5A0HouwMQSUHouwNB6LsDQai8AxBIIABBwABqIABBgAFqQei8AxBIQai7A0GouwMgARBJQai8AyABIAEQSkHougNB6LoDQai9AxBJQai9A0GovQNBqL0DEElBqL0DQai9A0GovQMQSUGouwMgASABQcAAahBKIAFBwABqQei7AyABQcAAahBIIAFBwABqQai9AyABQcAAahBKQei8A0HovAMgAUGAAWoQSQvvAwIBfwF/IABBgAFqIQMgAUGAAWohBCAAEFAEQCABIAIQUg8LIAEQUARAIAAgAhBSDwsgAyADQei9AxBIIAQgBEGovgMQSCAAQai+A0HovgMQSCABQei9A0GovwMQSCADQei9A0HovwMQSCAEQai+A0GowAMQSCAAQcAAakGowANB6MADEEggAUHAAGpB6L8DQajBAxBIQei+A0GovwMQTgRAQejAA0GowQMQTgRAIAAgAhBTDwsLQai/A0HovgNB6MEDEEpBqMEDQejAA0GowgMQSkHowQNB6MEDQejCAxBJQejCA0HowgNB6MIDEEhB6MEDQejCA0GowwMQSEGowgNBqMIDQejDAxBJQei+A0HowgNB6MQDEEhB6MMDQejDA0GoxAMQSEHoxANB6MQDQajFAxBJQajEA0GowwMgAhBKIAJBqMUDIAIQSkHowANBqMMDQejFAxBIQejFA0HoxQNB6MUDEElB6MQDIAIgAkHAAGoQSiACQcAAakHowwMgAkHAAGoQSCACQcAAakHoxQMgAkHAAGoQSiADIAQgAkGAAWoQSSACQYABaiACQYABaiACQYABahBIIAJBgAFqQei9AyACQYABahBKIAJBgAFqQai+AyACQYABahBKIAJBgAFqQejBAyACQYABahBICyQAIAAgARBHIABBwABqIAFBwAB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4MDg4ODA4ODg4ODg6MDg4ODg4ODw4ODg8ODw8PAAQcjLBguAAgAAAAEAAQIBAAECAQQBAgMAAQIBBAECAwgBAgMEBQYDAAECAQQBAgMIAQIDBAUGAxABAgMEBQYDCAkKAwwFBgcAAQIBBAECAwgBAgMEBQYDEAECAwQFBgMICQoDDAUGByABAgMEBQYDCAkKAwwFBgcQERIDFAUGBxgJCgsMDQ4HAAECAQQBAgMIAQIDBAUGAxABAgMEBQYDCAkKAwwFBgcgAQIDBAUGAwgJCgMMBQYHEBESAxQFBgcYCQoLDA0OB0ABAgMEBQYDCAkKAwwFBgcQERIDFAUGBxgJCgsMDQ4HICEiAyQFBgcoCQoLDA0OBzAREhMUFRYHGBkaCxwNDg8=", "base64");
   5            exports.pq = 1000;
   6            exports.pr = 1768;
   7        
   8}).call(this,require("buffer").Buffer)
   9},{"buffer":10}],2:[function(require,module,exports){
  10/*
  11    Copyright 2019 0KIMS association.
  12
  13    This file is part of websnark (Web Assembly zkSnark Prover).
  14
  15    websnark is a free software: you can redistribute it and/or modify it
  16    under the terms of the GNU General Public License as published by
  17    the Free Software Foundation, either version 3 of the License, or
  18    (at your option) any later version.
  19
  20    websnark is distributed in the hope that it will be useful, but WITHOUT
  21    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  22    or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  23    License for more details.
  24
  25    You should have received a copy of the GNU General Public License
  26    along with websnark. If not, see <https://www.gnu.org/licenses/>.
  27*/
  28
  29/* globals window */
  30
  31const buildGroth16 = require("./src/groth16.js");
  32
  33buildGroth16().then( (groth16) => {
  34    window.groth16 = groth16;
  35    window.genZKSnarkProof = function(witness, provingKey, cb) {
  36
  37        const p = groth16.proof(witness, provingKey);
  38
  39        if (cb) {
  40            p.then( (proof) => {
  41                cb(null, proof);
  42            }, (err) => {
  43                cb(err);
  44            });
  45        } else {
  46            return p;
  47        }
  48    };
  49});
  50
  51
  52
  53},{"./src/groth16.js":4}],3:[function(require,module,exports){
  54var bigInt = (function (undefined) {
  55    "use strict";
  56
  57    var BASE = 1e7,
  58        LOG_BASE = 7,
  59        MAX_INT = 9007199254740992,
  60        MAX_INT_ARR = smallToArray(MAX_INT),
  61        DEFAULT_ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz";
  62
  63    var supportsNativeBigInt = typeof BigInt === "function";
  64
  65    function Integer(v, radix, alphabet, caseSensitive) {
  66        if (typeof v === "undefined") return Integer[0];
  67        if (typeof radix !== "undefined") return +radix === 10 && !alphabet ? parseValue(v) : parseBase(v, radix, alphabet, caseSensitive);
  68        return parseValue(v);
  69    }
  70
  71    function BigInteger(value, sign) {
  72        this.value = value;
  73        this.sign = sign;
  74        this.isSmall = false;
  75    }
  76    BigInteger.prototype = Object.create(Integer.prototype);
  77
  78    function SmallInteger(value) {
  79        this.value = value;
  80        this.sign = value < 0;
  81        this.isSmall = true;
  82    }
  83    SmallInteger.prototype = Object.create(Integer.prototype);
  84
  85    function NativeBigInt(value) {
  86        this.value = value;
  87    }
  88    NativeBigInt.prototype = Object.create(Integer.prototype);
  89
  90    function isPrecise(n) {
  91        return -MAX_INT < n && n < MAX_INT;
  92    }
  93
  94    function smallToArray(n) { // For performance reasons doesn't reference BASE, need to change this function if BASE changes
  95        if (n < 1e7)
  96            return [n];
  97        if (n < 1e14)
  98            return [n % 1e7, Math.floor(n / 1e7)];
  99        return [n % 1e7, Math.floor(n / 1e7) % 1e7, Math.floor(n / 1e14)];
 100    }
 101
 102    function arrayToSmall(arr) { // If BASE changes this function may need to change
 103        trim(arr);
 104        var length = arr.length;
 105        if (length < 4 && compareAbs(arr, MAX_INT_ARR) < 0) {
 106            switch (length) {
 107                case 0: return 0;
 108                case 1: return arr[0];
 109                case 2: return arr[0] + arr[1] * BASE;
 110                default: return arr[0] + (arr[1] + arr[2] * BASE) * BASE;
 111            }
 112        }
 113        return arr;
 114    }
 115
 116    function trim(v) {
 117        var i = v.length;
 118        while (v[--i] === 0);
 119        v.length = i + 1;
 120    }
 121
 122    function createArray(length) { // function shamelessly stolen from Yaffle's library https://github.com/Yaffle/BigInteger
 123        var x = new Array(length);
 124        var i = -1;
 125        while (++i < length) {
 126            x[i] = 0;
 127        }
 128        return x;
 129    }
 130
 131    function truncate(n) {
 132        if (n > 0) return Math.floor(n);
 133        return Math.ceil(n);
 134    }
 135
 136    function add(a, b) { // assumes a and b are arrays with a.length >= b.length
 137        var l_a = a.length,
 138            l_b = b.length,
 139            r = new Array(l_a),
 140            carry = 0,
 141            base = BASE,
 142            sum, i;
 143        for (i = 0; i < l_b; i++) {
 144            sum = a[i] + b[i] + carry;
 145            carry = sum >= base ? 1 : 0;
 146            r[i] = sum - carry * base;
 147        }
 148        while (i < l_a) {
 149            sum = a[i] + carry;
 150            carry = sum === base ? 1 : 0;
 151            r[i++] = sum - carry * base;
 152        }
 153        if (carry > 0) r.push(carry);
 154        return r;
 155    }
 156
 157    function addAny(a, b) {
 158        if (a.length >= b.length) return add(a, b);
 159        return add(b, a);
 160    }
 161
 162    function addSmall(a, carry) { // assumes a is array, carry is number with 0 <= carry < MAX_INT
 163        var l = a.length,
 164            r = new Array(l),
 165            base = BASE,
 166            sum, i;
 167        for (i = 0; i < l; i++) {
 168            sum = a[i] - base + carry;
 169            carry = Math.floor(sum / base);
 170            r[i] = sum - carry * base;
 171            carry += 1;
 172        }
 173        while (carry > 0) {
 174            r[i++] = carry % base;
 175            carry = Math.floor(carry / base);
 176        }
 177        return r;
 178    }
 179
 180    BigInteger.prototype.add = function (v) {
 181        var n = parseValue(v);
 182        if (this.sign !== n.sign) {
 183            return this.subtract(n.negate());
 184        }
 185        var a = this.value, b = n.value;
 186        if (n.isSmall) {
 187            return new BigInteger(addSmall(a, Math.abs(b)), this.sign);
 188        }
 189        return new BigInteger(addAny(a, b), this.sign);
 190    };
 191    BigInteger.prototype.plus = BigInteger.prototype.add;
 192
 193    SmallInteger.prototype.add = function (v) {
 194        var n = parseValue(v);
 195        var a = this.value;
 196        if (a < 0 !== n.sign) {
 197            return this.subtract(n.negate());
 198        }
 199        var b = n.value;
 200        if (n.isSmall) {
 201            if (isPrecise(a + b)) return new SmallInteger(a + b);
 202            b = smallToArray(Math.abs(b));
 203        }
 204        return new BigInteger(addSmall(b, Math.abs(a)), a < 0);
 205    };
 206    SmallInteger.prototype.plus = SmallInteger.prototype.add;
 207
 208    NativeBigInt.prototype.add = function (v) {
 209        return new NativeBigInt(this.value + parseValue(v).value);
 210    }
 211    NativeBigInt.prototype.plus = NativeBigInt.prototype.add;
 212
 213    function subtract(a, b) { // assumes a and b are arrays with a >= b
 214        var a_l = a.length,
 215            b_l = b.length,
 216            r = new Array(a_l),
 217            borrow = 0,
 218            base = BASE,
 219            i, difference;
 220        for (i = 0; i < b_l; i++) {
 221            difference = a[i] - borrow - b[i];
 222            if (difference < 0) {
 223                difference += base;
 224                borrow = 1;
 225            } else borrow = 0;
 226            r[i] = difference;
 227        }
 228        for (i = b_l; i < a_l; i++) {
 229            difference = a[i] - borrow;
 230            if (difference < 0) difference += base;
 231            else {
 232                r[i++] = difference;
 233                break;
 234            }
 235            r[i] = difference;
 236        }
 237        for (; i < a_l; i++) {
 238            r[i] = a[i];
 239        }
 240        trim(r);
 241        return r;
 242    }
 243
 244    function subtractAny(a, b, sign) {
 245        var value;
 246        if (compareAbs(a, b) >= 0) {
 247            value = subtract(a, b);
 248        } else {
 249            value = subtract(b, a);
 250            sign = !sign;
 251        }
 252        value = arrayToSmall(value);
 253        if (typeof value === "number") {
 254            if (sign) value = -value;
 255            return new SmallInteger(value);
 256        }
 257        return new BigInteger(value, sign);
 258    }
 259
 260    function subtractSmall(a, b, sign) { // assumes a is array, b is number with 0 <= b < MAX_INT
 261        var l = a.length,
 262            r = new Array(l),
 263            carry = -b,
 264            base = BASE,
 265            i, difference;
 266        for (i = 0; i < l; i++) {
 267            difference = a[i] + carry;
 268            carry = Math.floor(difference / base);
 269            difference %= base;
 270            r[i] = difference < 0 ? difference + base : difference;
 271        }
 272        r = arrayToSmall(r);
 273        if (typeof r === "number") {
 274            if (sign) r = -r;
 275            return new SmallInteger(r);
 276        } return new BigInteger(r, sign);
 277    }
 278
 279    BigInteger.prototype.subtract = function (v) {
 280        var n = parseValue(v);
 281        if (this.sign !== n.sign) {
 282            return this.add(n.negate());
 283        }
 284        var a = this.value, b = n.value;
 285        if (n.isSmall)
 286            return subtractSmall(a, Math.abs(b), this.sign);
 287        return subtractAny(a, b, this.sign);
 288    };
 289    BigInteger.prototype.minus = BigInteger.prototype.subtract;
 290
 291    SmallInteger.prototype.subtract = function (v) {
 292        var n = parseValue(v);
 293        var a = this.value;
 294        if (a < 0 !== n.sign) {
 295            return this.add(n.negate());
 296        }
 297        var b = n.value;
 298        if (n.isSmall) {
 299            return new SmallInteger(a - b);
 300        }
 301        return subtractSmall(b, Math.abs(a), a >= 0);
 302    };
 303    SmallInteger.prototype.minus = SmallInteger.prototype.subtract;
 304
 305    NativeBigInt.prototype.subtract = function (v) {
 306        return new NativeBigInt(this.value - parseValue(v).value);
 307    }
 308    NativeBigInt.prototype.minus = NativeBigInt.prototype.subtract;
 309
 310    BigInteger.prototype.negate = function () {
 311        return new BigInteger(this.value, !this.sign);
 312    };
 313    SmallInteger.prototype.negate = function () {
 314        var sign = this.sign;
 315        var small = new SmallInteger(-this.value);
 316        small.sign = !sign;
 317        return small;
 318    };
 319    NativeBigInt.prototype.negate = function () {
 320        return new NativeBigInt(-this.value);
 321    }
 322
 323    BigInteger.prototype.abs = function () {
 324        return new BigInteger(this.value, false);
 325    };
 326    SmallInteger.prototype.abs = function () {
 327        return new SmallInteger(Math.abs(this.value));
 328    };
 329    NativeBigInt.prototype.abs = function () {
 330        return new NativeBigInt(this.value >= 0 ? this.value : -this.value);
 331    }
 332
 333
 334    function multiplyLong(a, b) {
 335        var a_l = a.length,
 336            b_l = b.length,
 337            l = a_l + b_l,
 338            r = createArray(l),
 339            base = BASE,
 340            product, carry, i, a_i, b_j;
 341        for (i = 0; i < a_l; ++i) {
 342            a_i = a[i];
 343            for (var j = 0; j < b_l; ++j) {
 344                b_j = b[j];
 345                product = a_i * b_j + r[i + j];
 346                carry = Math.floor(product / base);
 347                r[i + j] = product - carry * base;
 348                r[i + j + 1] += carry;
 349            }
 350        }
 351        trim(r);
 352        return r;
 353    }
 354
 355    function multiplySmall(a, b) { // assumes a is array, b is number with |b| < BASE
 356        var l = a.length,
 357            r = new Array(l),
 358            base = BASE,
 359            carry = 0,
 360            product, i;
 361        for (i = 0; i < l; i++) {
 362            product = a[i] * b + carry;
 363            carry = Math.floor(product / base);
 364            r[i] = product - carry * base;
 365        }
 366        while (carry > 0) {
 367            r[i++] = carry % base;
 368            carry = Math.floor(carry / base);
 369        }
 370        return r;
 371    }
 372
 373    function shiftLeft(x, n) {
 374        var r = [];
 375        while (n-- > 0) r.push(0);
 376        return r.concat(x);
 377    }
 378
 379    function multiplyKaratsuba(x, y) {
 380        var n = Math.max(x.length, y.length);
 381
 382        if (n <= 30) return multiplyLong(x, y);
 383        n = Math.ceil(n / 2);
 384
 385        var b = x.slice(n),
 386            a = x.slice(0, n),
 387            d = y.slice(n),
 388            c = y.slice(0, n);
 389
 390        var ac = multiplyKaratsuba(a, c),
 391            bd = multiplyKaratsuba(b, d),
 392            abcd = multiplyKaratsuba(addAny(a, b), addAny(c, d));
 393
 394        var product = addAny(addAny(ac, shiftLeft(subtract(subtract(abcd, ac), bd), n)), shiftLeft(bd, 2 * n));
 395        trim(product);
 396        return product;
 397    }
 398
 399    // The following function is derived from a surface fit of a graph plotting the performance difference
 400    // between long multiplication and karatsuba multiplication versus the lengths of the two arrays.
 401    function useKaratsuba(l1, l2) {
 402        return -0.012 * l1 - 0.012 * l2 + 0.000015 * l1 * l2 > 0;
 403    }
 404
 405    BigInteger.prototype.multiply = function (v) {
 406        var n = parseValue(v),
 407            a = this.value, b = n.value,
 408            sign = this.sign !== n.sign,
 409            abs;
 410        if (n.isSmall) {
 411            if (b === 0) return Integer[0];
 412            if (b === 1) return this;
 413            if (b === -1) return this.negate();
 414            abs = Math.abs(b);
 415            if (abs < BASE) {
 416                return new BigInteger(multiplySmall(a, abs), sign);
 417            }
 418            b = smallToArray(abs);
 419        }
 420        if (useKaratsuba(a.length, b.length)) // Karatsuba is only faster for certain array sizes
 421            return new BigInteger(multiplyKaratsuba(a, b), sign);
 422        return new BigInteger(multiplyLong(a, b), sign);
 423    };
 424
 425    BigInteger.prototype.times = BigInteger.prototype.multiply;
 426
 427    function multiplySmallAndArray(a, b, sign) { // a >= 0
 428        if (a < BASE) {
 429            return new BigInteger(multiplySmall(b, a), sign);
 430        }
 431        return new BigInteger(multiplyLong(b, smallToArray(a)), sign);
 432    }
 433    SmallInteger.prototype._multiplyBySmall = function (a) {
 434        if (isPrecise(a.value * this.value)) {
 435            return new SmallInteger(a.value * this.value);
 436        }
 437        return multiplySmallAndArray(Math.abs(a.value), smallToArray(Math.abs(this.value)), this.sign !== a.sign);
 438    };
 439    BigInteger.prototype._multiplyBySmall = function (a) {
 440        if (a.value === 0) return Integer[0];
 441        if (a.value === 1) return this;
 442        if (a.value === -1) return this.negate();
 443        return multiplySmallAndArray(Math.abs(a.value), this.value, this.sign !== a.sign);
 444    };
 445    SmallInteger.prototype.multiply = function (v) {
 446        return parseValue(v)._multiplyBySmall(this);
 447    };
 448    SmallInteger.prototype.times = SmallInteger.prototype.multiply;
 449
 450    NativeBigInt.prototype.multiply = function (v) {
 451        return new NativeBigInt(this.value * parseValue(v).value);
 452    }
 453    NativeBigInt.prototype.times = NativeBigInt.prototype.multiply;
 454
 455    function square(a) {
 456        //console.assert(2 * BASE * BASE < MAX_INT);
 457        var l = a.length,
 458            r = createArray(l + l),
 459            base = BASE,
 460            product, carry, i, a_i, a_j;
 461        for (i = 0; i < l; i++) {
 462            a_i = a[i];
 463            carry = 0 - a_i * a_i;
 464            for (var j = i; j < l; j++) {
 465                a_j = a[j];
 466                product = 2 * (a_i * a_j) + r[i + j] + carry;
 467                carry = Math.floor(product / base);
 468                r[i + j] = product - carry * base;
 469            }
 470            r[i + l] = carry;
 471        }
 472        trim(r);
 473        return r;
 474    }
 475
 476    BigInteger.prototype.square = function () {
 477        return new BigInteger(square(this.value), false);
 478    };
 479
 480    SmallInteger.prototype.square = function () {
 481        var value = this.value * this.value;
 482        if (isPrecise(value)) return new SmallInteger(value);
 483        return new BigInteger(square(smallToArray(Math.abs(this.value))), false);
 484    };
 485
 486    NativeBigInt.prototype.square = function (v) {
 487        return new NativeBigInt(this.value * this.value);
 488    }
 489
 490    function divMod1(a, b) { // Left over from previous version. Performs faster than divMod2 on smaller input sizes.
 491        var a_l = a.length,
 492            b_l = b.length,
 493            base = BASE,
 494            result = createArray(b.length),
 495            divisorMostSignificantDigit = b[b_l - 1],
 496            // normalization
 497            lambda = Math.ceil(base / (2 * divisorMostSignificantDigit)),
 498            remainder = multiplySmall(a, lambda),
 499            divisor = multiplySmall(b, lambda),
 500            quotientDigit, shift, carry, borrow, i, l, q;
 501        if (remainder.length <= a_l) remainder.push(0);
 502        divisor.push(0);
 503        divisorMostSignificantDigit = divisor[b_l - 1];
 504        for (shift = a_l - b_l; shift >= 0; shift--) {
 505            quotientDigit = base - 1;
 506            if (remainder[shift + b_l] !== divisorMostSignificantDigit) {
 507                quotientDigit = Math.floor((remainder[shift + b_l] * base + remainder[shift + b_l - 1]) / divisorMostSignificantDigit);
 508            }
 509            // quotientDigit <= base - 1
 510            carry = 0;
 511            borrow = 0;
 512            l = divisor.length;
 513            for (i = 0; i < l; i++) {
 514                carry += quotientDigit * divisor[i];
 515                q = Math.floor(carry / base);
 516                borrow += remainder[shift + i] - (carry - q * base);
 517                carry = q;
 518                if (borrow < 0) {
 519                    remainder[shift + i] = borrow + base;
 520                    borrow = -1;
 521                } else {
 522                    remainder[shift + i] = borrow;
 523                    borrow = 0;
 524                }
 525            }
 526            while (borrow !== 0) {
 527                quotientDigit -= 1;
 528                carry = 0;
 529                for (i = 0; i < l; i++) {
 530                    carry += remainder[shift + i] - base + divisor[i];
 531                    if (carry < 0) {
 532                        remainder[shift + i] = carry + base;
 533                        carry = 0;
 534                    } else {
 535                        remainder[shift + i] = carry;
 536                        carry = 1;
 537                    }
 538                }
 539                borrow += carry;
 540            }
 541            result[shift] = quotientDigit;
 542        }
 543        // denormalization
 544        remainder = divModSmall(remainder, lambda)[0];
 545        return [arrayToSmall(result), arrayToSmall(remainder)];
 546    }
 547
 548    function divMod2(a, b) { // Implementation idea shamelessly stolen from Silent Matt's library http://silentmatt.com/biginteger/
 549        // Performs faster than divMod1 on larger input sizes.
 550        var a_l = a.length,
 551            b_l = b.length,
 552            result = [],
 553            part = [],
 554            base = BASE,
 555            guess, xlen, highx, highy, check;
 556        while (a_l) {
 557            part.unshift(a[--a_l]);
 558            trim(part);
 559            if (compareAbs(part, b) < 0) {
 560                result.push(0);
 561                continue;
 562            }
 563            xlen = part.length;
 564            highx = part[xlen - 1] * base + part[xlen - 2];
 565            highy = b[b_l - 1] * base + b[b_l - 2];
 566            if (xlen > b_l) {
 567                highx = (highx + 1) * base;
 568            }
 569            guess = Math.ceil(highx / highy);
 570            do {
 571                check = multiplySmall(b, guess);
 572                if (compareAbs(check, part) <= 0) break;
 573                guess--;
 574            } while (guess);
 575            result.push(guess);
 576            part = subtract(part, check);
 577        }
 578        result.reverse();
 579        return [arrayToSmall(result), arrayToSmall(part)];
 580    }
 581
 582    function divModSmall(value, lambda) {
 583        var length = value.length,
 584            quotient = createArray(length),
 585            base = BASE,
 586            i, q, remainder, divisor;
 587        remainder = 0;
 588        for (i = length - 1; i >= 0; --i) {
 589            divisor = remainder * base + value[i];
 590            q = truncate(divisor / lambda);
 591            remainder = divisor - q * lambda;
 592            quotient[i] = q | 0;
 593        }
 594        return [quotient, remainder | 0];
 595    }
 596
 597    function divModAny(self, v) {
 598        var value, n = parseValue(v);
 599        if (supportsNativeBigInt) {
 600            return [new NativeBigInt(self.value / n.value), new NativeBigInt(self.value % n.value)];
 601        }
 602        var a = self.value, b = n.value;
 603        var quotient;
 604        if (b === 0) throw new Error("Cannot divide by zero");
 605        if (self.isSmall) {
 606            if (n.isSmall) {
 607                return [new SmallInteger(truncate(a / b)), new SmallInteger(a % b)];
 608            }
 609            return [Integer[0], self];
 610        }
 611        if (n.isSmall) {
 612            if (b === 1) return [self, Integer[0]];
 613            if (b == -1) return [self.negate(), Integer[0]];
 614            var abs = Math.abs(b);
 615            if (abs < BASE) {
 616                value = divModSmall(a, abs);
 617                quotient = arrayToSmall(value[0]);
 618                var remainder = value[1];
 619                if (self.sign) remainder = -remainder;
 620                if (typeof quotient === "number") {
 621                    if (self.sign !== n.sign) quotient = -quotient;
 622                    return [new SmallInteger(quotient), new SmallInteger(remainder)];
 623                }
 624                return [new BigInteger(quotient, self.sign !== n.sign), new SmallInteger(remainder)];
 625            }
 626            b = smallToArray(abs);
 627        }
 628        var comparison = compareAbs(a, b);
 629        if (comparison === -1) return [Integer[0], self];
 630        if (comparison === 0) return [Integer[self.sign === n.sign ? 1 : -1], Integer[0]];
 631
 632        // divMod1 is faster on smaller input sizes
 633        if (a.length + b.length <= 200)
 634            value = divMod1(a, b);
 635        else value = divMod2(a, b);
 636
 637        quotient = value[0];
 638        var qSign = self.sign !== n.sign,
 639            mod = value[1],
 640            mSign = self.sign;
 641        if (typeof quotient === "number") {
 642            if (qSign) quotient = -quotient;
 643            quotient = new SmallInteger(quotient);
 644        } else quotient = new BigInteger(quotient, qSign);
 645        if (typeof mod === "number") {
 646            if (mSign) mod = -mod;
 647            mod = new SmallInteger(mod);
 648        } else mod = new BigInteger(mod, mSign);
 649        return [quotient, mod];
 650    }
 651
 652    BigInteger.prototype.divmod = function (v) {
 653        var result = divModAny(this, v);
 654        return {
 655            quotient: result[0],
 656            remainder: result[1]
 657        };
 658    };
 659    NativeBigInt.prototype.divmod = SmallInteger.prototype.divmod = BigInteger.prototype.divmod;
 660
 661
 662    BigInteger.prototype.divide = function (v) {
 663        return divModAny(this, v)[0];
 664    };
 665    NativeBigInt.prototype.over = NativeBigInt.prototype.divide = function (v) {
 666        return new NativeBigInt(this.value / parseValue(v).value);
 667    };
 668    SmallInteger.prototype.over = SmallInteger.prototype.divide = BigInteger.prototype.over = BigInteger.prototype.divide;
 669
 670    BigInteger.prototype.mod = function (v) {
 671        return divModAny(this, v)[1];
 672    };
 673    NativeBigInt.prototype.mod = NativeBigInt.prototype.remainder = function (v) {
 674        return new NativeBigInt(this.value % parseValue(v).value);
 675    };
 676    SmallInteger.prototype.remainder = SmallInteger.prototype.mod = BigInteger.prototype.remainder = BigInteger.prototype.mod;
 677
 678    BigInteger.prototype.pow = function (v) {
 679        var n = parseValue(v),
 680            a = this.value,
 681            b = n.value,
 682            value, x, y;
 683        if (b === 0) return Integer[1];
 684        if (a === 0) return Integer[0];
 685        if (a === 1) return Integer[1];
 686        if (a === -1) return n.isEven() ? Integer[1] : Integer[-1];
 687        if (n.sign) {
 688            return Integer[0];
 689        }
 690        if (!n.isSmall) throw new Error("The exponent " + n.toString() + " is too large.");
 691        if (this.isSmall) {
 692            if (isPrecise(value = Math.pow(a, b)))
 693                return new SmallInteger(truncate(value));
 694        }
 695        x = this;
 696        y = Integer[1];
 697        while (true) {
 698            if (b & 1 === 1) {
 699                y = y.times(x);
 700                --b;
 701            }
 702            if (b === 0) break;
 703            b /= 2;
 704            x = x.square();
 705        }
 706        return y;
 707    };
 708    SmallInteger.prototype.pow = BigInteger.prototype.pow;
 709
 710    NativeBigInt.prototype.pow = function (v) {
 711        var n = parseValue(v);
 712        var a = this.value, b = n.value;
 713        var _0 = BigInt(0), _1 = BigInt(1), _2 = BigInt(2);
 714        if (b === _0) return Integer[1];
 715        if (a === _0) return Integer[0];
 716        if (a === _1) return Integer[1];
 717        if (a === BigInt(-1)) return n.isEven() ? Integer[1] : Integer[-1];
 718        if (n.isNegative()) return new NativeBigInt(_0);
 719        var x = this;
 720        var y = Integer[1];
 721        while (true) {
 722            if ((b & _1) === _1) {
 723                y = y.times(x);
 724                --b;
 725            }
 726            if (b === _0) break;
 727            b /= _2;
 728            x = x.square();
 729        }
 730        return y;
 731    }
 732
 733    BigInteger.prototype.modPow = function (exp, mod) {
 734        exp = parseValue(exp);
 735        mod = parseValue(mod);
 736        if (mod.isZero()) throw new Error("Cannot take modPow with modulus 0");
 737        var r = Integer[1],
 738            base = this.mod(mod);
 739        while (exp.isPositive()) {
 740            if (base.isZero()) return Integer[0];
 741            if (exp.isOdd()) r = r.multiply(base).mod(mod);
 742            exp = exp.divide(2);
 743            base = base.square().mod(mod);
 744        }
 745        return r;
 746    };
 747    NativeBigInt.prototype.modPow = SmallInteger.prototype.modPow = BigInteger.prototype.modPow;
 748
 749    function compareAbs(a, b) {
 750        if (a.length !== b.length) {
 751            return a.length > b.length ? 1 : -1;
 752        }
 753        for (var i = a.length - 1; i >= 0; i--) {
 754            if (a[i] !== b[i]) return a[i] > b[i] ? 1 : -1;
 755        }
 756        return 0;
 757    }
 758
 759    BigInteger.prototype.compareAbs = function (v) {
 760        var n = parseValue(v),
 761            a = this.value,
 762            b = n.value;
 763        if (n.isSmall) return 1;
 764        return compareAbs(a, b);
 765    };
 766    SmallInteger.prototype.compareAbs = function (v) {
 767        var n = parseValue(v),
 768            a = Math.abs(this.value),
 769            b = n.value;
 770        if (n.isSmall) {
 771            b = Math.abs(b);
 772            return a === b ? 0 : a > b ? 1 : -1;
 773        }
 774        return -1;
 775    };
 776    NativeBigInt.prototype.compareAbs = function (v) {
 777        var a = this.value;
 778        var b = parseValue(v).value;
 779        a = a >= 0 ? a : -a;
 780        b = b >= 0 ? b : -b;
 781        return a === b ? 0 : a > b ? 1 : -1;
 782    }
 783
 784    BigInteger.prototype.compare = function (v) {
 785        // See discussion about comparison with Infinity:
 786        // https://github.com/peterolson/BigInteger.js/issues/61
 787        if (v === Infinity) {
 788            return -1;
 789        }
 790        if (v === -Infinity) {
 791            return 1;
 792        }
 793
 794        var n = parseValue(v),
 795            a = this.value,
 796            b = n.value;
 797        if (this.sign !== n.sign) {
 798            return n.sign ? 1 : -1;
 799        }
 800        if (n.isSmall) {
 801            return this.sign ? -1 : 1;
 802        }
 803        return compareAbs(a, b) * (this.sign ? -1 : 1);
 804    };
 805    BigInteger.prototype.compareTo = BigInteger.prototype.compare;
 806
 807    SmallInteger.prototype.compare = function (v) {
 808        if (v === Infinity) {
 809            return -1;
 810        }
 811        if (v === -Infinity) {
 812            return 1;
 813        }
 814
 815        var n = parseValue(v),
 816            a = this.value,
 817            b = n.value;
 818        if (n.isSmall) {
 819            return a == b ? 0 : a > b ? 1 : -1;
 820        }
 821        if (a < 0 !== n.sign) {
 822            return a < 0 ? -1 : 1;
 823        }
 824        return a < 0 ? 1 : -1;
 825    };
 826    SmallInteger.prototype.compareTo = SmallInteger.prototype.compare;
 827
 828    NativeBigInt.prototype.compare = function (v) {
 829        if (v === Infinity) {
 830            return -1;
 831        }
 832        if (v === -Infinity) {
 833            return 1;
 834        }
 835        var a = this.value;
 836        var b = parseValue(v).value;
 837        return a === b ? 0 : a > b ? 1 : -1;
 838    }
 839    NativeBigInt.prototype.compareTo = NativeBigInt.prototype.compare;
 840
 841    BigInteger.prototype.equals = function (v) {
 842        return this.compare(v) === 0;
 843    };
 844    NativeBigInt.prototype.eq = NativeBigInt.prototype.equals = SmallInteger.prototype.eq = SmallInteger.prototype.equals = BigInteger.prototype.eq = BigInteger.prototype.equals;
 845
 846    BigInteger.prototype.notEquals = function (v) {
 847        return this.compare(v) !== 0;
 848    };
 849    NativeBigInt.prototype.neq = NativeBigInt.prototype.notEquals = SmallInteger.prototype.neq = SmallInteger.prototype.notEquals = BigInteger.prototype.neq = BigInteger.prototype.notEquals;
 850
 851    BigInteger.prototype.greater = function (v) {
 852        return this.compare(v) > 0;
 853    };
 854    NativeBigInt.prototype.gt = NativeBigInt.prototype.greater = SmallInteger.prototype.gt = SmallInteger.prototype.greater = BigInteger.prototype.gt = BigInteger.prototype.greater;
 855
 856    BigInteger.prototype.lesser = function (v) {
 857        return this.compare(v) < 0;
 858    };
 859    NativeBigInt.prototype.lt = NativeBigInt.prototype.lesser = SmallInteger.prototype.lt = SmallInteger.prototype.lesser = BigInteger.prototype.lt = BigInteger.prototype.lesser;
 860
 861    BigInteger.prototype.greaterOrEquals = function (v) {
 862        return this.compare(v) >= 0;
 863    };
 864    NativeBigInt.prototype.geq = NativeBigInt.prototype.greaterOrEquals = SmallInteger.prototype.geq = SmallInteger.prototype.greaterOrEquals = BigInteger.prototype.geq = BigInteger.prototype.greaterOrEquals;
 865
 866    BigInteger.prototype.lesserOrEquals = function (v) {
 867        return this.compare(v) <= 0;
 868    };
 869    NativeBigInt.prototype.leq = NativeBigInt.prototype.lesserOrEquals = SmallInteger.prototype.leq = SmallInteger.prototype.lesserOrEquals = BigInteger.prototype.leq = BigInteger.prototype.lesserOrEquals;
 870
 871    BigInteger.prototype.isEven = function () {
 872        return (this.value[0] & 1) === 0;
 873    };
 874    SmallInteger.prototype.isEven = function () {
 875        return (this.value & 1) === 0;
 876    };
 877    NativeBigInt.prototype.isEven = function () {
 878        return (this.value & BigInt(1)) === BigInt(0);
 879    }
 880
 881    BigInteger.prototype.isOdd = function () {
 882        return (this.value[0] & 1) === 1;
 883    };
 884    SmallInteger.prototype.isOdd = function () {
 885        return (this.value & 1) === 1;
 886    };
 887    NativeBigInt.prototype.isOdd = function () {
 888        return (this.value & BigInt(1)) === BigInt(1);
 889    }
 890
 891    BigInteger.prototype.isPositive = function () {
 892        return !this.sign;
 893    };
 894    SmallInteger.prototype.isPositive = function () {
 895        return this.value > 0;
 896    };
 897    NativeBigInt.prototype.isPositive = SmallInteger.prototype.isPositive;
 898
 899    BigInteger.prototype.isNegative = function () {
 900        return this.sign;
 901    };
 902    SmallInteger.prototype.isNegative = function () {
 903        return this.value < 0;
 904    };
 905    NativeBigInt.prototype.isNegative = SmallInteger.prototype.isNegative;
 906
 907    BigInteger.prototype.isUnit = function () {
 908        return false;
 909    };
 910    SmallInteger.prototype.isUnit = function () {
 911        return Math.abs(this.value) === 1;
 912    };
 913    NativeBigInt.prototype.isUnit = function () {
 914        return this.abs().value === BigInt(1);
 915    }
 916
 917    BigInteger.prototype.isZero = function () {
 918        return false;
 919    };
 920    SmallInteger.prototype.isZero = function () {
 921        return this.value === 0;
 922    };
 923    NativeBigInt.prototype.isZero = function () {
 924        return this.value === BigInt(0);
 925    }
 926
 927    BigInteger.prototype.isDivisibleBy = function (v) {
 928        var n = parseValue(v);
 929        if (n.isZero()) return false;
 930        if (n.isUnit()) return true;
 931        if (n.compareAbs(2) === 0) return this.isEven();
 932        return this.mod(n).isZero();
 933    };
 934    NativeBigInt.prototype.isDivisibleBy = SmallInteger.prototype.isDivisibleBy = BigInteger.prototype.isDivisibleBy;
 935
 936    function isBasicPrime(v) {
 937        var n = v.abs();
 938        if (n.isUnit()) return false;
 939        if (n.equals(2) || n.equals(3) || n.equals(5)) return true;
 940        if (n.isEven() || n.isDivisibleBy(3) || n.isDivisibleBy(5)) return false;
 941        if (n.lesser(49)) return true;
 942        // we don't know if it's prime: let the other functions figure it out
 943    }
 944
 945    function millerRabinTest(n, a) {
 946        var nPrev = n.prev(),
 947            b = nPrev,
 948            r = 0,
 949            d, t, i, x;
 950        while (b.isEven()) b = b.divide(2), r++;
 951        next: for (i = 0; i < a.length; i++) {
 952            if (n.lesser(a[i])) continue;
 953            x = bigInt(a[i]).modPow(b, n);
 954            if (x.isUnit() || x.equals(nPrev)) continue;
 955            for (d = r - 1; d != 0; d--) {
 956                x = x.square().mod(n);
 957                if (x.isUnit()) return false;
 958                if (x.equals(nPrev)) continue next;
 959            }
 960            return false;
 961        }
 962        return true;
 963    }
 964
 965    // Set "strict" to true to force GRH-supported lower bound of 2*log(N)^2
 966    BigInteger.prototype.isPrime = function (strict) {
 967        var isPrime = isBasicPrime(this);
 968        if (isPrime !== undefined) return isPrime;
 969        var n = this.abs();
 970        var bits = n.bitLength();
 971        if (bits <= 64)
 972            return millerRabinTest(n, [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]);
 973        var logN = Math.log(2) * bits.toJSNumber();
 974        var t = Math.ceil((strict === true) ? (2 * Math.pow(logN, 2)) : logN);
 975        for (var a = [], i = 0; i < t; i++) {
 976            a.push(bigInt(i + 2));
 977        }
 978        return millerRabinTest(n, a);
 979    };
 980    NativeBigInt.prototype.isPrime = SmallInteger.prototype.isPrime = BigInteger.prototype.isPrime;
 981
 982    BigInteger.prototype.isProbablePrime = function (iterations) {
 983        var isPrime = isBasicPrime(this);
 984        if (isPrime !== undefined) return isPrime;
 985        var n = this.abs();
 986        var t = iterations === undefined ? 5 : iterations;
 987        for (var a = [], i = 0; i < t; i++) {
 988            a.push(bigInt.randBetween(2, n.minus(2)));
 989        }
 990        return millerRabinTest(n, a);
 991    };
 992    NativeBigInt.prototype.isProbablePrime = SmallInteger.prototype.isProbablePrime = BigInteger.prototype.isProbablePrime;
 993
 994    BigInteger.prototype.modInv = function (n) {
 995        var t = bigInt.zero, newT = bigInt.one, r = parseValue(n), newR = this.abs(), q, lastT, lastR;
 996        while (!newR.isZero()) {
 997            q = r.divide(newR);
 998            lastT = t;
 999            lastR = r;
1000            t = newT;
1001            r = newR;
1002            newT = lastT.subtract(q.multiply(newT));
1003            newR = lastR.subtract(q.multiply(newR));
1004        }
1005        if (!r.isUnit()) throw new Error(this.toString() + " and " + n.toString() + " are not co-prime");
1006        if (t.compare(0) === -1) {
1007            t = t.add(n);
1008        }
1009        if (this.isNegative()) {
1010            return t.negate();
1011        }
1012        return t;
1013    };
1014
1015    NativeBigInt.prototype.modInv = SmallInteger.prototype.modInv = BigInteger.prototype.modInv;
1016
1017    BigInteger.prototype.next = function () {
1018        var value = this.value;
1019        if (this.sign) {
1020            return subtractSmall(value, 1, this.sign);
1021        }
1022        return new BigInteger(addSmall(value, 1), this.sign);
1023    };
1024    SmallInteger.prototype.next = function () {
1025        var value = this.value;
1026        if (value + 1 < MAX_INT) return new SmallInteger(value + 1);
1027        return new BigInteger(MAX_INT_ARR, false);
1028    };
1029    NativeBigInt.prototype.next = function () {
1030        return new NativeBigInt(this.value + BigInt(1));
1031    }
1032
1033    BigInteger.prototype.prev = function () {
1034        var value = this.value;
1035        if (this.sign) {
1036            return new BigInteger(addSmall(value, 1), true);
1037        }
1038        return subtractSmall(value, 1, this.sign);
1039    };
1040    SmallInteger.prototype.prev = function () {
1041        var value = this.value;
1042        if (value - 1 > -MAX_INT) return new SmallInteger(value - 1);
1043        return new BigInteger(MAX_INT_ARR, true);
1044    };
1045    NativeBigInt.prototype.prev = function () {
1046        return new NativeBigInt(this.value - BigInt(1));
1047    }
1048
1049    var powersOfTwo = [1];
1050    while (2 * powersOfTwo[powersOfTwo.length - 1] <= BASE) powersOfTwo.push(2 * powersOfTwo[powersOfTwo.length - 1]);
1051    var powers2Length = powersOfTwo.length, highestPower2 = powersOfTwo[powers2Length - 1];
1052
1053    function shift_isSmall(n) {
1054        return Math.abs(n) <= BASE;
1055    }
1056
1057    BigInteger.prototype.shiftLeft = function (v) {
1058        var n = parseValue(v).toJSNumber();
1059        if (!shift_isSmall(n)) {
1060            throw new Error(String(n) + " is too large for shifting.");
1061        }
1062        if (n < 0) return this.shiftRight(-n);
1063        var result = this;
1064        if (result.isZero()) return result;
1065        while (n >= powers2Length) {
1066            result = result.multiply(highestPower2);
1067            n -= powers2Length - 1;
1068        }
1069        return result.multiply(powersOfTwo[n]);
1070    };
1071    NativeBigInt.prototype.shiftLeft = SmallInteger.prototype.shiftLeft = BigInteger.prototype.shiftLeft;
1072
1073    BigInteger.prototype.shiftRight = function (v) {
1074        var remQuo;
1075        var n = parseValue(v).toJSNumber();
1076        if (!shift_isSmall(n)) {
1077            throw new Error(String(n) + " is too large for shifting.");
1078        }
1079        if (n < 0) return this.shiftLeft(-n);
1080        var result = this;
1081        while (n >= powers2Length) {
1082            if (result.isZero() || (result.isNegative() && result.isUnit())) return result;
1083            remQuo = divModAny(result, highestPower2);
1084            result = remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];
1085            n -= powers2Length - 1;
1086        }
1087        remQuo = divModAny(result, powersOfTwo[n]);
1088        return remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];
1089    };
1090    NativeBigInt.prototype.shiftRight = SmallInteger.prototype.shiftRight = BigInteger.prototype.shiftRight;
1091
1092    function bitwise(x, y, fn) {
1093        y = parseValue(y);
1094        var xSign = x.isNegative(), ySign = y.isNegative();
1095        var xRem = xSign ? x.not() : x,
1096            yRem = ySign ? y.not() : y;
1097        var xDigit = 0, yDigit = 0;
1098        var xDivMod = null, yDivMod = null;
1099        var result = [];
1100        while (!xRem.isZero() || !yRem.isZero()) {
1101            xDivMod = divModAny(xRem, highestPower2);
1102            xDigit = xDivMod[1].toJSNumber();
1103            if (xSign) {
1104                xDigit = highestPower2 - 1 - xDigit; // two's complement for negative numbers
1105            }
1106
1107            yDivMod = divModAny(yRem, highestPower2);
1108            yDigit = yDivMod[1].toJSNumber();
1109            if (ySign) {
1110                yDigit = highestPower2 - 1 - yDigit; // two's complement for negative numbers
1111            }
1112
1113            xRem = xDivMod[0];
1114            yRem = yDivMod[0];
1115            result.push(fn(xDigit, yDigit));
1116        }
1117        var sum = fn(xSign ? 1 : 0, ySign ? 1 : 0) !== 0 ? bigInt(-1) : bigInt(0);
1118        for (var i = result.length - 1; i >= 0; i -= 1) {
1119            sum = sum.multiply(highestPower2).add(bigInt(result[i]));
1120        }
1121        return sum;
1122    }
1123
1124    BigInteger.prototype.not = function () {
1125        return this.negate().prev();
1126    };
1127    NativeBigInt.prototype.not = SmallInteger.prototype.not = BigInteger.prototype.not;
1128
1129    BigInteger.prototype.and = function (n) {
1130        return bitwise(this, n, function (a, b) { return a & b; });
1131    };
1132    NativeBigInt.prototype.and = SmallInteger.prototype.and = BigInteger.prototype.and;
1133
1134    BigInteger.prototype.or = function (n) {
1135        return bitwise(this, n, function (a, b) { return a | b; });
1136    };
1137    NativeBigInt.prototype.or = SmallInteger.prototype.or = BigInteger.prototype.or;
1138
1139    BigInteger.prototype.xor = function (n) {
1140        return bitwise(this, n, function (a, b) { return a ^ b; });
1141    };
1142    NativeBigInt.prototype.xor = SmallInteger.prototype.xor = BigInteger.prototype.xor;
1143
1144    var LOBMASK_I = 1 << 30, LOBMASK_BI = (BASE & -BASE) * (BASE & -BASE) | LOBMASK_I;
1145    function roughLOB(n) { // get lowestOneBit (rough)
1146        // SmallInteger: return Min(lowestOneBit(n), 1 << 30)
1147        // BigInteger: return Min(lowestOneBit(n), 1 << 14) [BASE=1e7]
1148        var v = n.value,
1149            x = typeof v === "number" ? v | LOBMASK_I :
1150                typeof v === "bigint" ? v | BigInt(LOBMASK_I) :
1151                    v[0] + v[1] * BASE | LOBMASK_BI;
1152        return x & -x;
1153    }
1154
1155    function integerLogarithm(value, base) {
1156        if (base.compareTo(value) <= 0) {
1157            var tmp = integerLogarithm(value, base.square(base));
1158            var p = tmp.p;
1159            var e = tmp.e;
1160            var t = p.multiply(base);
1161            return t.compareTo(value) <= 0 ? { p: t, e: e * 2 + 1 } : { p: p, e: e * 2 };
1162        }
1163        return { p: bigInt(1), e: 0 };
1164    }
1165
1166    BigInteger.prototype.bitLength = function () {
1167        var n = this;
1168        if (n.compareTo(bigInt(0)) < 0) {
1169            n = n.negate().subtract(bigInt(1));
1170        }
1171        if (n.compareTo(bigInt(0)) === 0) {
1172            return bigInt(0);
1173        }
1174        return bigInt(integerLogarithm(n, bigInt(2)).e).add(bigInt(1));
1175    }
1176    NativeBigInt.prototype.bitLength = SmallInteger.prototype.bitLength = BigInteger.prototype.bitLength;
1177
1178    function max(a, b) {
1179        a = parseValue(a);
1180        b = parseValue(b);
1181        return a.greater(b) ? a : b;
1182    }
1183    function min(a, b) {
1184        a = parseValue(a);
1185        b = parseValue(b);
1186        return a.lesser(b) ? a : b;
1187    }
1188    function gcd(a, b) {
1189        a = parseValue(a).abs();
1190        b = parseValue(b).abs();
1191        if (a.equals(b)) return a;
1192        if (a.isZero()) return b;
1193        if (b.isZero()) return a;
1194        var c = Integer[1], d, t;
1195        while (a.isEven() && b.isEven()) {
1196            d = min(roughLOB(a), roughLOB(b));
1197            a = a.divide(d);
1198            b = b.divide(d);
1199            c = c.multiply(d);
1200        }
1201        while (a.isEven()) {
1202            a = a.divide(roughLOB(a));
1203        }
1204        do {
1205            while (b.isEven()) {
1206                b = b.divide(roughLOB(b));
1207            }
1208            if (a.greater(b)) {
1209                t = b; b = a; a = t;
1210            }
1211            b = b.subtract(a);
1212        } while (!b.isZero());
1213        return c.isUnit() ? a : a.multiply(c);
1214    }
1215    function lcm(a, b) {
1216        a = parseValue(a).abs();
1217        b = parseValue(b).abs();
1218        return a.divide(gcd(a, b)).multiply(b);
1219    }
1220    function randBetween(a, b) {
1221        a = parseValue(a);
1222        b = parseValue(b);
1223        var low = min(a, b), high = max(a, b);
1224        var range = high.subtract(low).add(1);
1225        if (range.isSmall) return low.add(Math.floor(Math.random() * range));
1226        var digits = toBase(range, BASE).value;
1227        var result = [], restricted = true;
1228        for (var i = 0; i < digits.length; i++) {
1229            var top = restricted ? digits[i] : BASE;
1230            var digit = truncate(Math.random() * top);
1231            result.push(digit);
1232            if (digit < top) restricted = false;
1233        }
1234        return low.add(Integer.fromArray(result, BASE, false));
1235    }
1236
1237    var parseBase = function (text, base, alphabet, caseSensitive) {
1238        alphabet = alphabet || DEFAULT_ALPHABET;
1239        text = String(text);
1240        if (!caseSensitive) {
1241            text = text.toLowerCase();
1242            alphabet = alphabet.toLowerCase();
1243        }
1244        var length = text.length;
1245        var i;
1246        var absBase = Math.abs(base);
1247        var alphabetValues = {};
1248        for (i = 0; i < alphabet.length; i++) {
1249            alphabetValues[alphabet[i]] = i;
1250        }
1251        for (i = 0; i < length; i++) {
1252            var c = text[i];
1253            if (c === "-") continue;
1254            if (c in alphabetValues) {
1255                if (alphabetValues[c] >= absBase) {
1256                    if (c === "1" && absBase === 1) continue;
1257                    throw new Error(c + " is not a valid digit in base " + base + ".");
1258                }
1259            }
1260        }
1261        base = parseValue(base);
1262        var digits = [];
1263        var isNegative = text[0] === "-";
1264        for (i = isNegative ? 1 : 0; i < text.length; i++) {
1265            var c = text[i];
1266            if (c in alphabetValues) digits.push(parseValue(alphabetValues[c]));
1267            else if (c === "<") {
1268                var start = i;
1269                do { i++; } while (text[i] !== ">" && i < text.length);
1270                digits.push(parseValue(text.slice(start + 1, i)));
1271            }
1272            else throw new Error(c + " is not a valid character");
1273        }
1274        return parseBaseFromArray(digits, base, isNegative);
1275    };
1276
1277    function parseBaseFromArray(digits, base, isNegative) {
1278        var val = Integer[0], pow = Integer[1], i;
1279        for (i = digits.length - 1; i >= 0; i--) {
1280            val = val.add(digits[i].times(pow));
1281            pow = pow.times(base);
1282        }
1283        return isNegative ? val.negate() : val;
1284    }
1285
1286    function stringify(digit, alphabet) {
1287        alphabet = alphabet || DEFAULT_ALPHABET;
1288        if (digit < alphabet.length) {
1289            return alphabet[digit];
1290        }
1291        return "<" + digit + ">";
1292    }
1293
1294    function toBase(n, base) {
1295        base = bigInt(base);
1296        if (base.isZero()) {
1297            if (n.isZero()) return { value: [0], isNegative: false };
1298            throw new Error("Cannot convert nonzero numbers to base 0.");
1299        }
1300        if (base.equals(-1)) {
1301            if (n.isZero()) return { value: [0], isNegative: false };
1302            if (n.isNegative())
1303                return {
1304                    value: [].concat.apply([], Array.apply(null, Array(-n.toJSNumber()))
1305                        .map(Array.prototype.valueOf, [1, 0])
1306                    ),
1307                    isNegative: false
1308                };
1309
1310            var arr = Array.apply(null, Array(n.toJSNumber() - 1))
1311                .map(Array.prototype.valueOf, [0, 1]);
1312            arr.unshift([1]);
1313            return {
1314                value: [].concat.apply([], arr),
1315                isNegative: false
1316            };
1317        }
1318
1319        var neg = false;
1320        if (n.isNegative() && base.isPositive()) {
1321            neg = true;
1322            n = n.abs();
1323        }
1324        if (base.isUnit()) {
1325            if (n.isZero()) return { value: [0], isNegative: false };
1326
1327            return {
1328                value: Array.apply(null, Array(n.toJSNumber()))
1329                    .map(Number.prototype.valueOf, 1),
1330                isNegative: neg
1331            };
1332        }
1333        var out = [];
1334        var left = n, divmod;
1335        while (left.isNegative() || left.compareAbs(base) >= 0) {
1336            divmod = left.divmod(base);
1337            left = divmod.quotient;
1338            var digit = divmod.remainder;
1339            if (digit.isNegative()) {
1340                digit = base.minus(digit).abs();
1341                left = left.next();
1342            }
1343            out.push(digit.toJSNumber());
1344        }
1345        out.push(left.toJSNumber());
1346        return { value: out.reverse(), isNegative: neg };
1347    }
1348
1349    function toBaseString(n, base, alphabet) {
1350        var arr = toBase(n, base);
1351        return (arr.isNegative ? "-" : "") + arr.value.map(function (x) {
1352            return stringify(x, alphabet);
1353        }).join('');
1354    }
1355
1356    BigInteger.prototype.toArray = function (radix) {
1357        return toBase(this, radix);
1358    };
1359
1360    SmallInteger.prototype.toArray = function (radix) {
1361        return toBase(this, radix);
1362    };
1363
1364    NativeBigInt.prototype.toArray = function (radix) {
1365        return toBase(this, radix);
1366    };
1367
1368    BigInteger.prototype.toString = function (radix, alphabet) {
1369        if (radix === undefined) radix = 10;
1370        if (radix !== 10) return toBaseString(this, radix, alphabet);
1371        var v = this.value, l = v.length, str = String(v[--l]), zeros = "0000000", digit;
1372        while (--l >= 0) {
1373            digit = String(v[l]);
1374            str += zeros.slice(digit.length) + digit;
1375        }
1376        var sign = this.sign ? "-" : "";
1377        return sign + str;
1378    };
1379
1380    SmallInteger.prototype.toString = function (radix, alphabet) {
1381        if (radix === undefined) radix = 10;
1382        if (radix != 10) return toBaseString(this, radix, alphabet);
1383        return String(this.value);
1384    };
1385
1386    NativeBigInt.prototype.toString = SmallInteger.prototype.toString;
1387
1388    NativeBigInt.prototype.toJSON = BigInteger.prototype.toJSON = SmallInteger.prototype.toJSON = function () { return this.toString(); }
1389
1390    BigInteger.prototype.valueOf = function () {
1391        return parseInt(this.toString(), 10);
1392    };
1393    BigInteger.prototype.toJSNumber = BigInteger.prototype.valueOf;
1394
1395    SmallInteger.prototype.valueOf = function () {
1396        return this.value;
1397    };
1398    SmallInteger.prototype.toJSNumber = SmallInteger.prototype.valueOf;
1399    NativeBigInt.prototype.valueOf = NativeBigInt.prototype.toJSNumber = function () {
1400        return parseInt(this.toString(), 10);
1401    }
1402
1403    function parseStringValue(v) {
1404        if (isPrecise(+v)) {
1405            var x = +v;
1406            if (x === truncate(x))
1407                return supportsNativeBigInt ? new NativeBigInt(BigInt(x)) : new SmallInteger(x);
1408            throw new Error("Invalid integer: " + v);
1409        }
1410        var sign = v[0] === "-";
1411        if (sign) v = v.slice(1);
1412        var split = v.split(/e/i);
1413        if (split.length > 2) throw new Error("Invalid integer: " + split.join("e"));
1414        if (split.length === 2) {
1415            var exp = split[1];
1416            if (exp[0] === "+") exp = exp.slice(1);
1417            exp = +exp;
1418            if (exp !== truncate(exp) || !isPrecise(exp)) throw new Error("Invalid integer: " + exp + " is not a valid exponent.");
1419            var text = split[0];
1420            var decimalPlace = text.indexOf(".");
1421            if (decimalPlace >= 0) {
1422                exp -= text.length - decimalPlace - 1;
1423                text = text.slice(0, decimalPlace) + text.slice(decimalPlace + 1);
1424            }
1425            if (exp < 0) throw new Error("Cannot include negative exponent part for integers");
1426            text += (new Array(exp + 1)).join("0");
1427            v = text;
1428        }
1429        var isValid = /^([0-9][0-9]*)$/.test(v);
1430        if (!isValid) throw new Error("Invalid integer: " + v);
1431        if (supportsNativeBigInt) {
1432            return new NativeBigInt(BigInt(sign ? "-" + v : v));
1433        }
1434        var r = [], max = v.length, l = LOG_BASE, min = max - l;
1435        while (max > 0) {
1436            r.push(+v.slice(min, max));
1437            min -= l;
1438            if (min < 0) min = 0;
1439            max -= l;
1440        }
1441        trim(r);
1442        return new BigInteger(r, sign);
1443    }
1444
1445    function parseNumberValue(v) {
1446        if (supportsNativeBigInt) {
1447            return new NativeBigInt(BigInt(v));
1448        }
1449        if (isPrecise(v)) {
1450            if (v !== truncate(v)) throw new Error(v + " is not an integer.");
1451            return new SmallInteger(v);
1452        }
1453        return parseStringValue(v.toString());
1454    }
1455
1456    function parseValue(v) {
1457        if (typeof v === "number") {
1458            return parseNumberValue(v);
1459        }
1460        if (typeof v === "string") {
1461            return parseStringValue(v);
1462        }
1463        if (typeof v === "bigint") {
1464            return new NativeBigInt(v);
1465        }
1466        return v;
1467    }
1468    // Pre-define numbers in range [-999,999]
1469    for (var i = 0; i < 1000; i++) {
1470        Integer[i] = parseValue(i);
1471        if (i > 0) Integer[-i] = parseValue(-i);
1472    }
1473    // Backwards compatibility
1474    Integer.one = Integer[1];
1475    Integer.zero = Integer[0];
1476    Integer.minusOne = Integer[-1];
1477    Integer.max = max;
1478    Integer.min = min;
1479    Integer.gcd = gcd;
1480    Integer.lcm = lcm;
1481    Integer.isInstance = function (x) { return x instanceof BigInteger || x instanceof SmallInteger || x instanceof NativeBigInt; };
1482    Integer.randBetween = randBetween;
1483
1484    Integer.fromArray = function (digits, base, isNegative) {
1485        return parseBaseFromArray(digits.map(parseValue), parseValue(base || 10), isNegative);
1486    };
1487
1488    return Integer;
1489})();
1490
1491// Node.js check
1492if (typeof module !== "undefined" && module.hasOwnProperty("exports")) {
1493    module.exports = bigInt;
1494}
1495
1496//amd check
1497if (typeof define === "function" && define.amd) {
1498    define("big-integer", [], function () {
1499        return bigInt;
1500    });
1501}
1502
1503},{}],4:[function(require,module,exports){
1504(function (process){
1505/*
1506    Copyright 2019 0KIMS association.
1507
1508    This file is part of websnark (Web Assembly zkSnark Prover).
1509
1510    websnark is a free software: you can redistribute it and/or modify it
1511    under the terms of the GNU General Public License as published by
1512    the Free Software Foundation, either version 3 of the License, or
1513    (at your option) any later version.
1514
1515    websnark is distributed in the hope that it will be useful, but WITHOUT
1516    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
1517    or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
1518    License for more details.
1519
1520    You should have received a copy of the GNU General Public License
1521    along with websnark. If not, see <https://www.gnu.org/licenses/>.
1522*/
1523
1524/* globals WebAssembly, Blob, Worker, navigator, Promise, window */
1525const bigInt = require("big-integer");
1526const groth16_wasm = require("../build/groth16_wasm.js");
1527const assert = require("assert");
1528
1529const inBrowser = (typeof window !== "undefined");
1530let NodeWorker;
1531let NodeCrypto;
1532if (!inBrowser) {
1533    NodeWorker = require("worker_threads").Worker;
1534    NodeCrypto = require("crypto");
1535}
1536
1537
1538class Deferred {
1539    constructor() {
1540        this.promise = new Promise((resolve, reject)=> {
1541            this.reject = reject;
1542            this.resolve = resolve;
1543        });
1544    }
1545}
1546
1547/*
1548function delay(ms) {
1549    return new Promise(resolve => setTimeout(resolve, ms));
1550}
1551*/
1552
1553function thread(self) {
1554    let instance;
1555    let memory;
1556    let i32;
1557
1558    async function init(data) {
1559        const code = new Uint8Array(data.code);
1560        const wasmModule = await WebAssembly.compile(code);
1561        memory = new WebAssembly.Memory({initial:data.init});
1562        i32 = new Uint32Array(memory.buffer);
1563
1564        instance = await WebAssembly.instantiate(wasmModule, {
1565            env: {
1566                "memory": memory
1567            }
1568        });
1569    }
1570
1571    function alloc(length) {
1572        while (i32[0] & 3) i32[0]++;  // Return always aligned pointers
1573        const res = i32[0];
1574        i32[0] += length;
1575        return res;
1576    }
1577
1578    function putBin(b) {
1579        const p = alloc(b.byteLength);
1580        const s32 = new Uint32Array(b);
1581        i32.set(s32, p/4);
1582        return p;
1583    }
1584
1585    function getBin(p, l) {
1586        return memory.buffer.slice(p, p+l);
1587    }
1588
1589    self.onmessage = function(e) {
1590        let data;
1591        if (e.data) {
1592            data = e.data;
1593        } else {
1594            data = e;
1595        }
1596
1597        if (data.command == "INIT") {
1598            init(data).then(function() {
1599                self.postMessage(data.result);
1600            });
1601        } else if (data.command == "G1_MULTIEXP") {
1602
1603            const oldAlloc = i32[0];
1604            const pScalars = putBin(data.scalars);
1605            const pPoints = putBin(data.points);
1606            const pRes = alloc(96);
1607            instance.exports.g1_zero(pRes);
1608            instance.exports.g1_multiexp2(pScalars, pPoints, data.n, 7, pRes);
1609
1610            data.result = getBin(pRes, 96);
1611            i32[0] = oldAlloc;
1612            self.postMessage(data.result, [data.result]);
1613        } else if (data.command == "G2_MULTIEXP") {
1614
1615            const oldAlloc = i32[0];
1616            const pScalars = putBin(data.scalars);
1617            const pPoints = putBin(data.points);
1618            const pRes = alloc(192);
1619            instance.exports.g2_zero(pRes);
1620            instance.exports.g2_multiexp(pScalars, pPoints, data.n, 7, pRes);
1621
1622            data.result = getBin(pRes, 192);
1623            i32[0] = oldAlloc;
1624            self.postMessage(data.result, [data.result]);
1625        } else if (data.command == "CALC_H") {
1626            const oldAlloc = i32[0];
1627            const pSignals = putBin(data.signals);
1628            const pPolsA = putBin(data.polsA);
1629            const pPolsB = putBin(data.polsB);
1630            const nSignals = data.nSignals;
1631            const domainSize = data.domainSize;
1632            const pSignalsM = alloc(nSignals*32);
1633            const pPolA = alloc(domainSize*32);
1634            const pPolB = alloc(domainSize*32);
1635            const pPolA2 = alloc(domainSize*32*2);
1636            const pPolB2 = alloc(domainSize*32*2);
1637
1638            instance.exports.fft_toMontgomeryN(pSignals, pSignalsM, nSignals);
1639
1640            instance.exports.pol_zero(pPolA, domainSize);
1641            instance.exports.pol_zero(pPolB, domainSize);
1642
1643            instance.exports.pol_constructLC(pPolsA, pSignalsM, nSignals, pPolA);
1644            instance.exports.pol_constructLC(pPolsB, pSignalsM, nSignals, pPolB);
1645
1646            instance.exports.fft_copyNInterleaved(pPolA, pPolA2, domainSize);
1647            instance.exports.fft_copyNInterleaved(pPolB, pPolB2, domainSize);
1648
1649            instance.exports.fft_ifft(pPolA, domainSize, 0);
1650            instance.exports.fft_ifft(pPolB, domainSize, 0);
1651            instance.exports.fft_fft(pPolA, domainSize, 1);
1652            instance.exports.fft_fft(pPolB, domainSize, 1);
1653
1654            instance.exports.fft_copyNInterleaved(pPolA, pPolA2+32, domainSize);
1655            instance.exports.fft_copyNInterleaved(pPolB, pPolB2+32, domainSize);
1656
1657            instance.exports.fft_mulN(pPolA2, pPolB2, domainSize*2, pPolA2);
1658
1659            instance.exports.fft_ifft(pPolA2, domainSize*2, 0);
1660
1661            instance.exports.fft_fromMontgomeryN(pPolA2+domainSize*32, pPolA2+domainSize*32, domainSize);
1662
1663            data.result = getBin(pPolA2+domainSize*32, domainSize*32);
1664            i32[0] = oldAlloc;
1665            self.postMessage(data.result, [data.result]);
1666        } else if (data.command == "TERMINATE") {
1667            process.exit();
1668        }
1669    };
1670}
1671
1672async function build() {
1673
1674    const groth16 = new Groth16();
1675
1676    groth16.q = bigInt("21888242871839275222246405745257275088696311157297823662689037894645226208583");
1677    groth16.r = bigInt("21888242871839275222246405745257275088548364400416034343698204186575808495617");
1678    groth16.n64 = Math.floor((groth16.q.minus(1).bitLength() - 1)/64) +1;
1679    groth16.n32 = groth16.n64*2;
1680    groth16.n8 = groth16.n64*8;
1681
1682    groth16.memory = new WebAssembly.Memory({initial:1000});
1683    groth16.i32 = new Uint32Array(groth16.memory.buffer);
1684
1685    const wasmModule = await WebAssembly.compile(groth16_wasm.code);
1686
1687    groth16.instance = await WebAssembly.instantiate(wasmModule, {
1688        env: {
1689            "memory": groth16.memory
1690        }
1691    });
1692
1693    groth16.pq = groth16_wasm.pq;
1694    groth16.pr = groth16_wasm.pr;
1695
1696    groth16.pr0 = groth16.alloc(192);
1697    groth16.pr1 = groth16.alloc(192);
1698
1699    groth16.workers = [];
1700    groth16.pendingDeferreds = [];
1701    groth16.working = [];
1702
1703    let concurrency;
1704
1705    if ((typeof(navigator) === "object") && navigator.hardwareConcurrency) {
1706        concurrency = navigator.hardwareConcurrency;
1707    } else {
1708        concurrency = 8;
1709    }
1710
1711    function getOnMsg(i) {
1712        return function(e) {
1713            let data;
1714            if ((e)&&(e.data)) {
1715                data = e.data;
1716            } else {
1717                data = e;
1718            }
1719
1720            groth16.working[i]=false;
1721            groth16.pendingDeferreds[i].resolve(data);
1722            groth16.processWorks();
1723        };
1724    }
1725
1726    for (let i = 0; i<concurrency; i++) {
1727
1728        if (inBrowser) {
1729            const blob = new Blob(["(", thread.toString(), ")(self);"], { type: "text/javascript" });
1730            const url = URL.createObjectURL(blob);
1731
1732            groth16.workers[i] = new Worker(url);
1733
1734            groth16.workers[i].onmessage = getOnMsg(i);
1735
1736        } else {
1737            groth16.workers[i] = new NodeWorker("(" + thread.toString()+ ")(require('worker_threads').parentPort);", {eval: true});
1738
1739            groth16.workers[i].on("message", getOnMsg(i));
1740        }
1741
1742        groth16.working[i]=false;
1743    }
1744
1745    const initPromises = [];
1746    for (let i=0; i<groth16.workers.length;i++) {
1747        const copyCode = groth16_wasm.code.buffer.slice(0);
1748        initPromises.push(groth16.postAction(i, {
1749            command: "INIT",
1750            init: 1000,
1751            code: copyCode
1752
1753        }, [copyCode]));
1754    }
1755
1756    await Promise.all(initPromises);
1757
1758    return groth16;
1759}
1760
1761class Groth16 {
1762    constructor() {
1763        this.actionQueue = [];
1764    }
1765
1766    postAction(workerId, e, transfers, _deferred) {
1767        assert(this.working[workerId] == false);
1768        this.working[workerId] = true;
1769
1770        this.pendingDeferreds[workerId] = _deferred ? _deferred : new Deferred();
1771        this.workers[workerId].postMessage(e, transfers);
1772
1773        return this.pendingDeferreds[workerId].promise;
1774    }
1775
1776    processWorks() {
1777        for (let i=0; (i<this.workers.length)&&(this.actionQueue.length > 0); i++) {
1778            if (this.working[i] == false) {
1779                const work = this.actionQueue.shift();
1780                this.postAction(i, work.data, work.transfers, work.deferred);
1781            }
1782        }
1783    }
1784
1785    queueAction(actionData, transfers) {
1786        const d = new Deferred();
1787        this.actionQueue.push({
1788            data: actionData,
1789            transfers: transfers,
1790            deferred: d
1791        });
1792        this.processWorks();
1793        return d.promise;
1794    }
1795
1796    alloc(length) {
1797        while (this.i32[0] & 3) this.i32[0]++;  // Return always aligned pointers
1798        const res = this.i32[0];
1799        this.i32[0] += length;
1800        return res;
1801    }
1802
1803
1804    putBin(p, b) {
1805        const s32 = new Uint32Array(b);
1806        this.i32.set(s32, p/4);
1807    }
1808
1809    getBin(p, l) {
1810        return this.memory.buffer.slice(p, p+l);
1811    }
1812
1813    bin2int(b) {
1814        const i32 = new Uint32Array(b);
1815        let acc = bigInt(i32[7]);
1816        for (let i=6; i>=0; i--) {
1817            acc = acc.shiftLeft(32);
1818            acc = acc.add(i32[i]);
1819        }
1820        return acc.toString();
1821    }
1822
1823    bin2g1(b) {
1824        return [
1825            this.bin2int(b.slice(0,32)),
1826            this.bin2int(b.slice(32,64)),
1827            this.bin2int(b.slice(64,96)),
1828        ];
1829    }
1830    bin2g2(b) {
1831        return [
1832            [
1833                this.bin2int(b.slice(0,32)),
1834                this.bin2int(b.slice(32,64))
1835            ],
1836            [
1837                this.bin2int(b.slice(64,96)),
1838                this.bin2int(b.slice(96,128))
1839            ],
1840            [
1841                this.bin2int(b.slice(128,160)),
1842                this.bin2int(b.slice(160,192))
1843            ],
1844        ];
1845    }
1846
1847    async g1_multiexp(scalars, points) {
1848        const nPoints = scalars.byteLength /32;
1849        const nPointsPerThread = Math.floor(nPoints / this.workers.length);
1850        const opPromises = [];
1851        for (let i=0; i<this.workers.length; i++) {
1852            const th_nPoints =
1853                i < this.workers.length -1 ?
1854                    nPointsPerThread :
1855                    nPoints - (nPointsPerThread * (this.workers.length -1));
1856            const scalars_th = scalars.slice(i*nPointsPerThread*32, i*nPointsPerThread*32 + th_nPoints*32);
1857            const points_th = points.slice(i*nPointsPerThread*64, i*nPointsPerThread*64 + th_nPoints*64);
1858            opPromises.push(
1859                this.queueAction({
1860                    command: "G1_MULTIEXP",
1861                    scalars: scalars_th,
1862                    points: points_th,
1863                    n: th_nPoints
1864                }, [scalars_th, points_th])
1865            );
1866        }
1867
1868        const results = await Promise.all(opPromises);
1869
1870        this.instance.exports.g1_zero(this.pr0);
1871        for (let i=0; i<results.length; i++) {
1872            this.putBin(this.pr1, results[i]);
1873            this.instance.exports.g1_add(this.pr0, this.pr1, this.pr0);
1874        }
1875
1876        return this.getBin(this.pr0, 96);
1877    }
1878
1879    async g2_multiexp(scalars, points) {
1880        const nPoints = scalars.byteLength /32;
1881        const nPointsPerThread = Math.floor(nPoints / this.workers.length);
1882        const opPromises = [];
1883        for (let i=0; i<this.workers.length; i++) {
1884            const th_nPoints =
1885                i < this.workers.length -1 ?
1886                    nPointsPerThread :
1887                    nPoints - (nPointsPerThread * (this.workers.length -1));
1888            const scalars_th = scalars.slice(i*nPointsPerThread*32, i*nPointsPerThread*32 + th_nPoints*32);
1889            const points_th = points.slice(i*nPointsPerThread*128, i*nPointsPerThread*128 + th_nPoints*128);
1890            opPromises.push(
1891                this.queueAction({
1892                    command: "G2_MULTIEXP",
1893                    scalars: scalars_th,
1894                    points: points_th,
1895                    n: th_nPoints
1896                }, [scalars_th, points_th])
1897            );
1898        }
1899
1900        const results = await Promise.all(opPromises);
1901
1902        this.instance.exports.g2_zero(this.pr0);
1903        for (let i=0; i<results.length; i++) {
1904            this.putBin(this.pr1, results[i]);
1905            this.instance.exports.g2_add(this.pr0, this.pr1, this.pr0);
1906        }
1907
1908        return this.getBin(this.pr0, 192);
1909    }
1910
1911    g1_affine(p) {
1912        this.putBin(this.pr0, p);
1913        this.instance.exports.g1_affine(this.pr0, this.pr0);
1914        return this.getBin(this.pr0, 96);
1915    }
1916
1917    g2_affine(p) {
1918        this.putBin(this.pr0, p);
1919        this.instance.exports.g2_affine(this.pr0, this.pr0);
1920        return this.getBin(this.pr0, 192);
1921    }
1922
1923    g1_fromMontgomery(p) {
1924        this.putBin(this.pr0, p);
1925        this.instance.exports.g1_fromMontgomery(this.pr0, this.pr0);
1926        return this.getBin(this.pr0, 96);
1927    }
1928
1929    g2_fromMontgomery(p) {
1930        this.putBin(this.pr0, p);
1931        this.instance.exports.g2_fromMontgomery(this.pr0, this.pr0);
1932        return this.getBin(this.pr0, 192);
1933    }
1934
1935    loadPoint1(b) {
1936        const p = this.alloc(96);
1937        this.putBin(p, b);
1938        this.instance.exports.f1m_one(p+64);
1939        return p;
1940    }
1941
1942    loadPoint2(b) {
1943        const p = this.alloc(192);
1944        this.putBin(p, b);
1945        this.instance.exports.f2m_one(p+128);
1946        return p;
1947    }
1948
1949    terminate() {
1950        for (let i=0; i<this.workers.length; i++) {
1951            this.workers[i].postMessage({command: "TERMINATE"});
1952        }
1953    }
1954
1955
1956    async calcH(signals, polsA, polsB, nSignals, domainSize) {
1957        return this.queueAction({
1958            command: "CALC_H",
1959            signals: signals,
1960            polsA: polsA,
1961            polsB: polsB,
1962            nSignals: nSignals,
1963            domainSize: domainSize
1964        }, [signals, polsA, polsB]);
1965    }
1966
1967    async proof(signals, pkey) {
1968        const pkey32 = new Uint32Array(pkey);
1969        const nSignals = pkey32[0];
1970        const nPublic = pkey32[1];
1971        const domainSize = pkey32[2];
1972        const pPolsA = pkey32[3];
1973        const pPolsB = pkey32[4];
1974        const pPointsA = pkey32[5];
1975        const pPointsB1 = pkey32[6];
1976        const pPointsB2 = pkey32[7];
1977        const pPointsC = pkey32[8];
1978        const pHExps = pkey32[9];
1979        const polsA = pkey.slice(pPolsA, pPolsA + pPolsB);
1980        const polsB = pkey.slice(pPolsB, pPolsB + pPointsA);
1981        const pointsA = pkey.slice(pPointsA, pPointsA + nSignals*64);
1982        const pointsB1 = pkey.slice(pPointsB1, pPointsB1 + nSignals*64);
1983        const pointsB2 = pkey.slice(pPointsB2, pPointsB2 + nSignals*128);
1984        const pointsC = pkey.slice(pPointsC, pPointsC + (nSignals-nPublic-1)*64);
1985        const pointsHExps = pkey.slice(pHExps, pHExps + domainSize*64);
1986
1987        const alfa1 = pkey.slice(10*4, 10*4 + 64);
1988        const beta1 = pkey.slice(10*4 + 64, 10*4 + 128);
1989        const delta1 = pkey.slice(10*4 + 128, 10*4 + 192);
1990        const beta2 = pkey.slice(10*4 + 192, 10*4 + 320);
1991        const delta2 = pkey.slice(10*4 + 320, 10*4 + 448);
1992
1993
1994        const pH = this.calcH(signals.slice(0), polsA, polsB, nSignals, domainSize).then( (h) => {
1995/* Debug code to print the result of h
1996            for (let i=0; i<domainSize; i++) {
1997                const a = this.bin2int(h.slice(i*32, i*32+32));
1998                console.log(i + " -> " + a.toString());
1999            }
2000*/
2001            return this.g1_multiexp(h, pointsHExps);
2002        });
2003
2004        const pA = this.g1_multiexp(signals.slice(0), pointsA);
2005        const pB1 = this.g1_multiexp(signals.slice(0), pointsB1);
2006        const pB2 = this.g2_multiexp(signals.slice(0), pointsB2);
2007        const pC = this.g1_multiexp(signals.slice((nPublic+1)*32), pointsC);
2008
2009        const res = await Promise.all([pA, pB1, pB2, pC, pH]);
2010
2011        const pi_a = this.alloc(96);
2012        const pi_b = this.alloc(192);
2013        const pi_c = this.alloc(96);
2014        const pib1 = this.alloc(96);
2015
2016
2017        this.putBin(pi_a, res[0]);
2018        this.putBin(pib1, res[1]);
2019        this.putBin(pi_b, res[2]);
2020        this.putBin(pi_c, res[3]);
2021
2022        const pAlfa1 = this.loadPoint1(alfa1);
2023        const pBeta1 = this.loadPoint1(beta1);
2024        const pDelta1 = this.loadPoint1(delta1);
2025        const pBeta2 = this.loadPoint2(beta2);
2026        const pDelta2 = this.loadPoint2(delta2);
2027
2028
2029        let rnd = new Uint32Array(8);
2030
2031        const aux1 = this.alloc(96);
2032        const aux2 = this.alloc(192);
2033
2034        const pr = this.alloc(32);
2035        const ps = this.alloc(32);
2036
2037        if (inBrowser) {
2038            window.crypto.getRandomValues(rnd);
2039            this.putBin(pr, rnd);
2040
2041            window.crypto.getRandomValues(rnd);
2042            this.putBin(ps, rnd);
2043        } else {
2044            const br = NodeCrypto.randomBytes(32);
2045            this.putBin(pr, br);
2046            const bs = NodeCrypto.randomBytes(32);
2047            this.putBin(ps, bs);
2048        }
2049
2050/// Uncoment it to debug and check it works
2051//        this.instance.exports.f1m_zero(pr);
2052//        this.instance.exports.f1m_zero(ps);
2053
2054        // pi_a = pi_a + Alfa1 + r*Delta1
2055        this.instance.exports.g1_add(pAlfa1, pi_a, pi_a);
2056        this.instance.exports.g1_timesScalar(pDelta1, pr, 32, aux1);
2057        this.instance.exports.g1_add(aux1, pi_a, pi_a);
2058
2059        // pi_b = pi_b + Beta2 + s*Delta2
2060        this.instance.exports.g2_add(pBeta2, pi_b, pi_b);
2061        this.instance.exports.g2_timesScalar(pDelta2, ps, 32, aux2);
2062        this.instance.exports.g2_add(aux2, pi_b, pi_b);
2063
2064        // pib1 = pib1 + Beta1 + s*Delta1
2065        this.instance.exports.g1_add(pBeta1, pib1, pib1);
2066        this.instance.exports.g1_timesScalar(pDelta1, ps, 32, aux1);
2067        this.instance.exports.g1_add(aux1, pib1, pib1);
2068
2069
2070        // pi_c = pi_c + pH
2071        this.putBin(aux1, res[4]);
2072        this.instance.exports.g1_add(aux1, pi_c, pi_c);
2073
2074
2075        // pi_c = pi_c + s*pi_a
2076        this.instance.exports.g1_timesScalar(pi_a, ps, 32, aux1);
2077        this.instance.exports.g1_add(aux1, pi_c, pi_c);
2078
2079        // pi_c = pi_c + r*pib1
2080        this.instance.exports.g1_timesScalar(pib1, pr, 32, aux1);
2081        this.instance.exports.g1_add(aux1, pi_c, pi_c);
2082
2083        // pi_c = pi_c - r*s*delta1
2084        const prs = this.alloc(64);
2085        this.instance.exports.int_mul(pr, ps, prs);
2086        this.instance.exports.g1_timesScalar(pDelta1, prs, 64, aux1);
2087        this.instance.exports.g1_neg(aux1, aux1);
2088        this.instance.exports.g1_add(aux1, pi_c, pi_c);
2089
2090        this.instance.exports.g1_affine(pi_a, pi_a);
2091        this.instance.exports.g2_affine(pi_b, pi_b);
2092        this.instance.exports.g1_affine(pi_c, pi_c);
2093
2094        this.instance.exports.g1_fromMontgomery(pi_a, pi_a);
2095        this.instance.exports.g2_fromMontgomery(pi_b, pi_b);
2096        this.instance.exports.g1_fromMontgomery(pi_c, pi_c);
2097
2098        return {
2099            pi_a: this.bin2g1(this.getBin(pi_a, 96)),
2100            pi_b: this.bin2g2(this.getBin(pi_b, 192)),
2101            pi_c: this.bin2g1(this.getBin(pi_c, 96)),
2102        };
2103
2104    }
2105
2106}
2107
2108module.exports = build;
2109
2110}).call(this,require('_process'))
2111},{"../build/groth16_wasm.js":1,"_process":12,"assert":5,"big-integer":3,"crypto":undefined,"worker_threads":undefined}],5:[function(require,module,exports){
2112(function (global){
2113'use strict';
2114
2115// compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js
2116// original notice:
2117
2118/*!
2119 * The buffer module from node.js, for the browser.
2120 *
2121 * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
2122 * @license  MIT
2123 */
2124function compare(a, b) {
2125  if (a === b) {
2126    return 0;
2127  }
2128
2129  var x = a.length;
2130  var y = b.length;
2131
2132  for (var i = 0, len = Math.min(x, y); i < len; ++i) {
2133    if (a[i] !== b[i]) {
2134      x = a[i];
2135      y = b[i];
2136      break;
2137    }
2138  }
2139
2140  if (x < y) {
2141    return -1;
2142  }
2143  if (y < x) {
2144    return 1;
2145  }
2146  return 0;
2147}
2148function isBuffer(b) {
2149  if (global.Buffer && typeof global.Buffer.isBuffer === 'function') {
2150    return global.Buffer.isBuffer(b);
2151  }
2152  return !!(b != null && b._isBuffer);
2153}
2154
2155// based on node assert, original notice:
2156
2157// http://wiki.commonjs.org/wiki/Unit_Testing/1.0
2158//
2159// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
2160//
2161// Originally from narwhal.js (http://narwhaljs.org)
2162// Copyright (c) 2009 Thomas Robinson <280north.com>
2163//
2164// Permission is hereby granted, free of charge, to any person obtaining a copy
2165// of this software and associated documentation files (the 'Software'), to
2166// deal in the Software without restriction, including without limitation the
2167// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
2168// sell copies of the Software, and to permit persons to whom the Software is
2169// furnished to do so, subject to the following conditions:
2170//
2171// The above copyright notice and this permission notice shall be included in
2172// all copies or substantial portions of the Software.
2173//
2174// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2175// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2176// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2177// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
2178// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
2179// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2180
2181var util = require('util/');
2182var hasOwn = Object.prototype.hasOwnProperty;
2183var pSlice = Array.prototype.slice;
2184var functionsHaveNames = (function () {
2185  return function foo() {}.name === 'foo';
2186}());
2187function pToString (obj) {
2188  return Object.prototype.toString.call(obj);
2189}
2190function isView(arrbuf) {
2191  if (isBuffer(arrbuf)) {
2192    return false;
2193  }
2194  if (typeof global.ArrayBuffer !== 'function') {
2195    return false;
2196  }
2197  if (typeof ArrayBuffer.isView === 'function') {
2198    return ArrayBuffer.isView(arrbuf);
2199  }
2200  if (!arrbuf) {
2201    return false;
2202  }
2203  if (arrbuf instanceof DataView) {
2204    return true;
2205  }
2206  if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) {
2207    return true;
2208  }
2209  return false;
2210}
2211// 1. The assert module provides functions that throw
2212// AssertionError's when particular conditions are not met. The
2213// assert module must conform to the following interface.
2214
2215var assert = module.exports = ok;
2216
2217// 2. The AssertionError is defined in assert.
2218// new assert.AssertionError({ message: message,
2219//                             actual: actual,
2220//                             expected: expected })
2221
2222var regex = /\s*function\s+([^\(\s]*)\s*/;
2223// based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js
2224function getName(func) {
2225  if (!util.isFunction(func)) {
2226    return;
2227  }
2228  if (functionsHaveNames) {
2229    return func.name;
2230  }
2231  var str = func.toString();
2232  var match = str.match(regex);
2233  return match && match[1];
2234}
2235assert.AssertionError = function AssertionError(options) {
2236  this.name = 'AssertionError';
2237  this.actual = options.actual;
2238  this.expected = options.expected;
2239  this.operator = options.operator;
2240  if (options.message) {
2241    this.message = options.message;
2242    this.generatedMessage = false;
2243  } else {
2244    this.message = getMessage(this);
2245    this.generatedMessage = true;
2246  }
2247  var stackStartFunction = options.stackStartFunction || fail;
2248  if (Error.captureStackTrace) {
2249    Error.captureStackTrace(this, stackStartFunction);
2250  } else {
2251    // non v8 browsers so we can have a stacktrace
2252    var err = new Error();
2253    if (err.stack) {
2254      var out = err.stack;
2255
2256      // try to strip useless frames
2257      var fn_name = getName(stackStartFunction);
2258      var idx = out.indexOf('\n' + fn_name);
2259      if (idx >= 0) {
2260        // once we have located the function frame
2261        // we need to strip out everything before it (and its line)
2262        var next_line = out.indexOf('\n', idx + 1);
2263        out = out.substring(next_line + 1);
2264      }
2265
2266      this.stack = out;
2267    }
2268  }
2269};
2270
2271// assert.AssertionError instanceof Error
2272util.inherits(assert.AssertionError, Error);
2273
2274function truncate(s, n) {
2275  if (typeof s === 'string') {
2276    return s.length < n ? s : s.slice(0, n);
2277  } else {
2278    return s;
2279  }
2280}
2281function inspect(something) {
2282  if (functionsHaveNames || !util.isFunction(something)) {
2283    return util.inspect(something);
2284  }
2285  var rawname = getName(something);
2286  var name = rawname ? ': ' + rawname : '';
2287  return '[Function' +  name + ']';
2288}
2289function getMessage(self) {
2290  return truncate(inspect(self.actual), 128) + ' ' +
2291         self.operator + ' ' +
2292         truncate(inspect(self.expected), 128);
2293}
2294
2295// At present only the three keys mentioned above are used and
2296// understood by the spec. Implementations or sub modules can pass
2297// other keys to the AssertionError's constructor - they will be
2298// ignored.
2299
2300// 3. All of the following functions must throw an AssertionError
2301// when a corresponding condition is not met, with a message that
2302// may be undefined if not provided.  All assertion methods provide
2303// both the actual and expected values to the assertion error for
2304// display purposes.
2305
2306function fail(actual, expected, message, operator, stackStartFunction) {
2307  throw new assert.AssertionError({
2308    message: message,
2309    actual: actual,
2310    expected: expected,
2311    operator: operator,
2312    stackStartFunction: stackStartFunction
2313  });
2314}
2315
2316// EXTENSION! allows for well behaved errors defined elsewhere.
2317assert.fail = fail;
2318
2319// 4. Pure assertion tests whether a value is truthy, as determined
2320// by !!guard.
2321// assert.ok(guard, message_opt);
2322// This statement is equivalent to assert.equal(true, !!guard,
2323// message_opt);. To test strictly for the value true, use
2324// assert.strictEqual(true, guard, message_opt);.
2325
2326function ok(value, message) {
2327  if (!value) fail(value, true, message, '==', assert.ok);
2328}
2329assert.ok = ok;
2330
2331// 5. The equality assertion tests shallow, coercive equality with
2332// ==.
2333// assert.equal(actual, expected, message_opt);
2334
2335assert.equal = function equal(actual, expected, message) {
2336  if (actual != expected) fail(actual, expected, message, '==', assert.equal);
2337};
2338
2339// 6. The non-equality assertion tests for whether two objects are not equal
2340// with != assert.notEqual(actual, expected, message_opt);
2341
2342assert.notEqual = function notEqual(actual, expected, message) {
2343  if (actual == expected) {
2344    fail(actual, expected, message, '!=', assert.notEqual);
2345  }
2346};
2347
2348// 7. The equivalence assertion tests a deep equality relation.
2349// assert.deepEqual(actual, expected, message_opt);
2350
2351assert.deepEqual = function deepEqual(actual, expected, message) {
2352  if (!_deepEqual(actual, expected, false)) {
2353    fail(actual, expected, message, 'deepEqual', assert.deepEqual);
2354  }
2355};
2356
2357assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {
2358  if (!_deepEqual(actual, expected, true)) {
2359    fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual);
2360  }
2361};
2362
2363function _deepEqual(actual, expected, strict, memos) {
2364  // 7.1. All identical values are equivalent, as determined by ===.
2365  if (actual === expected) {
2366    return true;
2367  } else if (isBuffer(actual) && isBuffer(expected)) {
2368    return compare(actual, expected) === 0;
2369
2370  // 7.2. If the expected value is a Date object, the actual value is
2371  // equivalent if it is also a Date object that refers to the same time.
2372  } else if (util.isDate(actual) && util.isDate(expected)) {
2373    return actual.getTime() === expected.getTime();
2374
2375  // 7.3 If the expected value is a RegExp object, the actual value is
2376  // equivalent if it is also a RegExp object with the same source and
2377  // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).
2378  } else if (util.isRegExp(actual) && util.isRegExp(expected)) {
2379    return actual.source === expected.source &&
2380           actual.global === expected.global &&
2381           actual.multiline === expected.multiline &&
2382           actual.lastIndex === expected.lastIndex &&
2383           actual.ignoreCase === expected.ignoreCase;
2384
2385  // 7.4. Other pairs that do not both pass typeof value == 'object',
2386  // equivalence is determined by ==.
2387  } else if ((actual === null || typeof actual !== 'object') &&
2388             (expected === null || typeof expected !== 'object')) {
2389    return strict ? actual === expected : actual == expected;
2390
2391  // If both values are instances of typed arrays, wrap their underlying
2392  // ArrayBuffers in a Buffer each to increase performance
2393  // This optimization requires the arrays to have the same type as checked by
2394  // Object.prototype.toString (aka pToString). Never perform binary
2395  // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their
2396  // bit patterns are not identical.
2397  } else if (isView(actual) && isView(expected) &&
2398             pToString(actual) === pToString(expected) &&
2399             !(actual instanceof Float32Array ||
2400               actual instanceof Float64Array)) {
2401    return compare(new Uint8Array(actual.buffer),
2402                   new Uint8Array(expected.buffer)) === 0;
2403
2404  // 7.5 For all other Object pairs, including Array objects, equivalence is
2405  // determined by having the same number of owned properties (as verified
2406  // with Object.prototype.hasOwnProperty.call), the same set of keys
2407  // (although not necessarily the same order), equivalent values for every
2408  // corresponding key, and an identical 'prototype' property. Note: this
2409  // accounts for both named and indexed properties on Arrays.
2410  } else if (isBuffer(actual) !== isBuffer(expected)) {
2411    return false;
2412  } else {
2413    memos = memos || {actual: [], expected: []};
2414
2415    var actualIndex = memos.actual.indexOf(actual);
2416    if (actualIndex !== -1) {
2417      if (actualIndex === memos.expected.indexOf(expected)) {
2418        return true;
2419      }
2420    }
2421
2422    memos.actual.push(actual);
2423    memos.expected.push(expected);
2424
2425    return objEquiv(actual, expected, strict, memos);
2426  }
2427}
2428
2429function isArguments(object) {
2430  return Object.prototype.toString.call(object) == '[object Arguments]';
2431}
2432
2433function objEquiv(a, b, strict, actualVisitedObjects) {
2434  if (a === null || a === undefined || b === null || b === undefined)
2435    return false;
2436  // if one is a primitive, the other must be same
2437  if (util.isPrimitive(a) || util.isPrimitive(b))
2438    return a === b;
2439  if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))
2440    return false;
2441  var aIsArgs = isArguments(a);
2442  var bIsArgs = isArguments(b);
2443  if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))
2444    return false;
2445  if (aIsArgs) {
2446    a = pSlice.call(a);
2447    b = pSlice.call(b);
2448    return _deepEqual(a, b, strict);
2449  }
2450  var ka = objectKeys(a);
2451  var kb = objectKeys(b);
2452  var key, i;
2453  // having the same number of owned properties (keys incorporates
2454  // hasOwnProperty)
2455  if (ka.length !== kb.length)
2456    return false;
2457  //the same set of keys (although not necessarily the same order),
2458  ka.sort();
2459  kb.sort();
2460  //~~~cheap key test
2461  for (i = ka.length - 1; i >= 0; i--) {
2462    if (ka[i] !== kb[i])
2463      return false;
2464  }
2465  //equivalent values for every corresponding key, and
2466  //~~~possibly expensive deep test
2467  for (i = ka.length - 1; i >= 0; i--) {
2468    key = ka[i];
2469    if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects))
2470      return false;
2471  }
2472  return true;
2473}
2474
2475// 8. The non-equivalence assertion tests for any deep inequality.
2476// assert.notDeepEqual(actual, expected, message_opt);
2477
2478assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
2479  if (_deepEqual(actual, expected, false)) {
2480    fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);
2481  }
2482};
2483
2484assert.notDeepStrictEqual = notDeepStrictEqual;
2485function notDeepStrictEqual(actual, expected, message) {
2486  if (_deepEqual(actual, expected, true)) {
2487    fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);
2488  }
2489}
2490
2491
2492// 9. The strict equality assertion tests strict equality, as determined by ===.
2493// assert.strictEqual(actual, expected, message_opt);
2494
2495assert.strictEqual = function strictEqual(actual, expected, message) {
2496  if (actual !== expected) {
2497    fail(actual, expected, message, '===', assert.strictEqual);
2498  }
2499};
2500
2501// 10. The strict non-equality assertion tests for strict inequality, as
2502// determined by !==.  assert.notStrictEqual(actual, expected, message_opt);
2503
2504assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
2505  if (actual === expected) {
2506    fail(actual, expected, message, '!==', assert.notStrictEqual);
2507  }
2508};
2509
2510function expectedException(actual, expected) {
2511  if (!actual || !expected) {
2512    return false;
2513  }
2514
2515  if (Object.prototype.toString.call(expected) == '[object RegExp]') {
2516    return expected.test(actual);
2517  }
2518
2519  try {
2520    if (actual instanceof expected) {
2521      return true;
2522    }
2523  } catch (e) {
2524    // Ignore.  The instanceof check doesn't work for arrow functions.
2525  }
2526
2527  if (Error.isPrototypeOf(expected)) {
2528    return false;
2529  }
2530
2531  return expected.call({}, actual) === true;
2532}
2533
2534function _tryBlock(block) {
2535  var error;
2536  try {
2537    block();
2538  } catch (e) {
2539    error = e;
2540  }
2541  return error;
2542}
2543
2544function _throws(shouldThrow, block, expected, message) {
2545  var actual;
2546
2547  if (typeof block !== 'function') {
2548    throw new TypeError('"block" argument must be a function');
2549  }
2550
2551  if (typeof expected === 'string') {
2552    message = expected;
2553    expected = null;
2554  }
2555
2556  actual = _tryBlock(block);
2557
2558  message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
2559            (message ? ' ' + message : '.');
2560
2561  if (shouldThrow && !actual) {
2562    fail(actual, expected, 'Missing expected exception' + message);
2563  }
2564
2565  var userProvidedMessage = typeof message === 'string';
2566  var isUnwantedException = !shouldThrow && util.isError(actual);
2567  var isUnexpectedException = !shouldThrow && actual && !expected;
2568
2569  if ((isUnwantedException &&
2570      userProvidedMessage &&
2571      expectedException(actual, expected)) ||
2572      isUnexpectedException) {
2573    fail(actual, expected, 'Got unwanted exception' + message);
2574  }
2575
2576  if ((shouldThrow && actual && expected &&
2577      !expectedException(actual, expected)) || (!shouldThrow && actual)) {
2578    throw actual;
2579  }
2580}
2581
2582// 11. Expected to throw an error:
2583// assert.throws(block, Error_opt, message_opt);
2584
2585assert.throws = function(block, /*optional*/error, /*optional*/message) {
2586  _throws(true, block, error, message);
2587};
2588
2589// EXTENSION! This is annoying to write outside this module.
2590assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) {
2591  _throws(false, block, error, message);
2592};
2593
2594assert.ifError = function(err) { if (err) throw err; };
2595
2596var objectKeys = Object.keys || function (obj) {
2597  var keys = [];
2598  for (var key in obj) {
2599    if (hasOwn.call(obj, key)) keys.push(key);
2600  }
2601  return keys;
2602};
2603
2604}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
2605},{"util/":8}],6:[function(require,module,exports){
2606if (typeof Object.create === 'function') {
2607  // implementation from standard node.js 'util' module
2608  module.exports = function inherits(ctor, superCtor) {
2609    ctor.super_ = superCtor
2610    ctor.prototype = Object.create(superCtor.prototype, {
2611      constructor: {
2612        value: ctor,
2613        enumerable: false,
2614        writable: true,
2615        configurable: true
2616      }
2617    });
2618  };
2619} else {
2620  // old school shim for old browsers
2621  module.exports = function inherits(ctor, superCtor) {
2622    ctor.super_ = superCtor
2623    var TempCtor = function () {}
2624    TempCtor.prototype = superCtor.prototype
2625    ctor.prototype = new TempCtor()
2626    ctor.prototype.constructor = ctor
2627  }
2628}
2629
2630},{}],7:[function(require,module,exports){
2631module.exports = function isBuffer(arg) {
2632  return arg && typeof arg === 'object'
2633    && typeof arg.copy === 'function'
2634    && typeof arg.fill === 'function'
2635    && typeof arg.readUInt8 === 'function';
2636}
2637},{}],8:[function(require,module,exports){
2638(function (process,global){
2639// Copyright Joyent, Inc. and other Node contributors.
2640//
2641// Permission is hereby granted, free of charge, to any person obtaining a
2642// copy of this software and associated documentation files (the
2643// "Software"), to deal in the Software without restriction, including
2644// without limitation the rights to use, copy, modify, merge, publish,
2645// distribute, sublicense, and/or sell copies of the Software, and to permit
2646// persons to whom the Software is furnished to do so, subject to the
2647// following conditions:
2648//
2649// The above copyright notice and this permission notice shall be included
2650// in all copies or substantial portions of the Software.
2651//
2652// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2653// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2654// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
2655// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
2656// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
2657// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2658// USE OR OTHER DEALINGS IN THE SOFTWARE.
2659
2660var formatRegExp = /%[sdj%]/g;
2661exports.format = function(f) {
2662  if (!isString(f)) {
2663    var objects = [];
2664    for (var i = 0; i < arguments.length; i++) {
2665      objects.push(inspect(arguments[i]));
2666    }
2667    return objects.join(' ');
2668  }
2669
2670  var i = 1;
2671  var args = arguments;
2672  var len = args.length;
2673  var str = String(f).replace(formatRegExp, function(x) {
2674    if (x === '%%') return '%';
2675    if (i >= len) return x;
2676    switch (x) {
2677      case '%s': return String(args[i++]);
2678      case '%d': return Number(args[i++]);
2679      case '%j':
2680        try {
2681          return JSON.stringify(args[i++]);
2682        } catch (_) {
2683          return '[Circular]';
2684        }
2685      default:
2686        return x;
2687    }
2688  });
2689  for (var x = args[i]; i < len; x = args[++i]) {
2690    if (isNull(x) || !isObject(x)) {
2691      str += ' ' + x;
2692    } else {
2693      str += ' ' + inspect(x);
2694    }
2695  }
2696  return str;
2697};
2698
2699
2700// Mark that a method should not be used.
2701// Returns a modified function which warns once by default.
2702// If --no-deprecation is set, then it is a no-op.
2703exports.deprecate = function(fn, msg) {
2704  // Allow for deprecating things in the process of starting up.
2705  if (isUndefined(global.process)) {
2706    return function() {
2707      return exports.deprecate(fn, msg).apply(this, arguments);
2708    };
2709  }
2710
2711  if (process.noDeprecation === true) {
2712    return fn;
2713  }
2714
2715  var warned = false;
2716  function deprecated() {
2717    if (!warned) {
2718      if (process.throwDeprecation) {
2719        throw new Error(msg);
2720      } else if (process.traceDeprecation) {
2721        console.trace(msg);
2722      } else {
2723        console.error(msg);
2724      }
2725      warned = true;
2726    }
2727    return fn.apply(this, arguments);
2728  }
2729
2730  return deprecated;
2731};
2732
2733
2734var debugs = {};
2735var debugEnviron;
2736exports.debuglog = function(set) {
2737  if (isUndefined(debugEnviron))
2738    debugEnviron = process.env.NODE_DEBUG || '';
2739  set = set.toUpperCase();
2740  if (!debugs[set]) {
2741    if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
2742      var pid = process.pid;
2743      debugs[set] = function() {
2744        var msg = exports.format.apply(exports, arguments);
2745        console.error('%s %d: %s', set, pid, msg);
2746      };
2747    } else {
2748      debugs[set] = function() {};
2749    }
2750  }
2751  return debugs[set];
2752};
2753
2754
2755/**
2756 * Echos the value of a value. Trys to print the value out
2757 * in the best way possible given the different types.
2758 *
2759 * @param {Object} obj The object to print out.
2760 * @param {Object} opts Optional options object that alters the output.
2761 */
2762/* legacy: obj, showHidden, depth, colors*/
2763function inspect(obj, opts) {
2764  // default options
2765  var ctx = {
2766    seen: [],
2767    stylize: stylizeNoColor
2768  };
2769  // legacy...
2770  if (arguments.length >= 3) ctx.depth = arguments[2];
2771  if (arguments.length >= 4) ctx.colors = arguments[3];
2772  if (isBoolean(opts)) {
2773    // legacy...
2774    ctx.showHidden = opts;
2775  } else if (opts) {
2776    // got an "options" object
2777    exports._extend(ctx, opts);
2778  }
2779  // set default options
2780  if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
2781  if (isUndefined(ctx.depth)) ctx.depth = 2;
2782  if (isUndefined(ctx.colors)) ctx.colors = false;
2783  if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
2784  if (ctx.colors) ctx.stylize = stylizeWithColor;
2785  return formatValue(ctx, obj, ctx.depth);
2786}
2787exports.inspect = inspect;
2788
2789
2790// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
2791inspect.colors = {
2792  'bold' : [1, 22],
2793  'italic' : [3, 23],
2794  'underline' : [4, 24],
2795  'inverse' : [7, 27],
2796  'white' : [37, 39],
2797  'grey' : [90, 39],
2798  'black' : [30, 39],
2799  'blue' : [34, 39],
2800  'cyan' : [36, 39],
2801  'green' : [32, 39],
2802  'magenta' : [35, 39],
2803  'red' : [31, 39],
2804  'yellow' : [33, 39]
2805};
2806
2807// Don't use 'blue' not visible on cmd.exe
2808inspect.styles = {
2809  'special': 'cyan',
2810  'number': 'yellow',
2811  'boolean': 'yellow',
2812  'undefined': 'grey',
2813  'null': 'bold',
2814  'string': 'green',
2815  'date': 'magenta',
2816  // "name": intentionally not styling
2817  'regexp': 'red'
2818};
2819
2820
2821function stylizeWithColor(str, styleType) {
2822  var style = inspect.styles[styleType];
2823
2824  if (style) {
2825    return '\u001b[' + inspect.colors[style][0] + 'm' + str +
2826           '\u001b[' + inspect.colors[style][1] + 'm';
2827  } else {
2828    return str;
2829  }
2830}
2831
2832
2833function stylizeNoColor(str, styleType) {
2834  return str;
2835}
2836
2837
2838function arrayToHash(array) {
2839  var hash = {};
2840
2841  array.forEach(function(val, idx) {
2842    hash[val] = true;
2843  });
2844
2845  return hash;
2846}
2847
2848
2849function formatValue(ctx, value, recurseTimes) {
2850  // Provide a hook for user-specified inspect functions.
2851  // Check that value is an object with an inspect function on it
2852  if (ctx.customInspect &&
2853      value &&
2854      isFunction(value.inspect) &&
2855      // Filter out the util module, it's inspect function is special
2856      value.inspect !== exports.inspect &&
2857      // Also filter out any prototype objects using the circular check.
2858      !(value.constructor && value.constructor.prototype === value)) {
2859    var ret = value.inspect(recurseTimes, ctx);
2860    if (!isString(ret)) {
2861      ret = formatValue(ctx, ret, recurseTimes);
2862    }
2863    return ret;
2864  }
2865
2866  // Primitive types cannot have properties
2867  var primitive = formatPrimitive(ctx, value);
2868  if (primitive) {
2869    return primitive;
2870  }
2871
2872  // Look up the keys of the object.
2873  var keys = Object.keys(value);
2874  var visibleKeys = arrayToHash(keys);
2875
2876  if (ctx.showHidden) {
2877    keys = Object.getOwnPropertyNames(value);
2878  }
2879
2880  // IE doesn't make error fields non-enumerable
2881  // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
2882  if (isError(value)
2883      && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
2884    return formatError(value);
2885  }
2886
2887  // Some type of object without properties can be shortcutted.
2888  if (keys.length === 0) {
2889    if (isFunction(value)) {
2890      var name = value.name ? ': ' + value.name : '';
2891      return ctx.stylize('[Function' + name + ']', 'special');
2892    }
2893    if (isRegExp(value)) {
2894      return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
2895    }
2896    if (isDate(value)) {
2897      return ctx.stylize(Date.prototype.toString.call(value), 'date');
2898    }
2899    if (isError(value)) {
2900      return formatError(value);
2901    }
2902  }
2903
2904  var base = '', array = false, braces = ['{', '}'];
2905
2906  // Make Array say that they are Array
2907  if (isArray(value)) {
2908    array = true;
2909    braces = ['[', ']'];
2910  }
2911
2912  // Make functions say that they are functions
2913  if (isFunction(value)) {
2914    var n = value.name ? ': ' + value.name : '';
2915    base = ' [Function' + n + ']';
2916  }
2917
2918  // Make RegExps say that they are RegExps
2919  if (isRegExp(value)) {
2920    base = ' ' + RegExp.prototype.toString.call(value);
2921  }
2922
2923  // Make dates with properties first say the date
2924  if (isDate(value)) {
2925    base = ' ' + Date.prototype.toUTCString.call(value);
2926  }
2927
2928  // Make error with message first say the error
2929  if (isError(value)) {
2930    base = ' ' + formatError(value);
2931  }
2932
2933  if (keys.length === 0 && (!array || value.length == 0)) {
2934    return braces[0] + base + braces[1];
2935  }
2936
2937  if (recurseTimes < 0) {
2938    if (isRegExp(value)) {
2939      return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
2940    } else {
2941      return ctx.stylize('[Object]', 'special');
2942    }
2943  }
2944
2945  ctx.seen.push(value);
2946
2947  var output;
2948  if (array) {
2949    output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
2950  } else {
2951    output = keys.map(function(key) {
2952      return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
2953    });
2954  }
2955
2956  ctx.seen.pop();
2957
2958  return reduceToSingleString(output, base, braces);
2959}
2960
2961
2962function formatPrimitive(ctx, value) {
2963  if (isUndefined(value))
2964    return ctx.stylize('undefined', 'undefined');
2965  if (isString(value)) {
2966    var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
2967                                             .replace(/'/g, "\\'")
2968                                             .replace(/\\"/g, '"') + '\'';
2969    return ctx.stylize(simple, 'string');
2970  }
2971  if (isNumber(value))
2972    return ctx.stylize('' + value, 'number');
2973  if (isBoolean(value))
2974    return ctx.stylize('' + value, 'boolean');
2975  // For some reason typeof null is "object", so special case here.
2976  if (isNull(value))
2977    return ctx.stylize('null', 'null');
2978}
2979
2980
2981function formatError(value) {
2982  return '[' + Error.prototype.toString.call(value) + ']';
2983}
2984
2985
2986function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
2987  var output = [];
2988  for (var i = 0, l = value.length; i < l; ++i) {
2989    if (hasOwnProperty(value, String(i))) {
2990      output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
2991          String(i), true));
2992    } else {
2993      output.push('');
2994    }
2995  }
2996  keys.forEach(function(key) {
2997    if (!key.match(/^\d+$/)) {
2998      output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
2999          key, true));
3000    }
3001  });
3002  return output;
3003}
3004
3005
3006function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
3007  var name, str, desc;
3008  desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
3009  if (desc.get) {
3010    if (desc.set) {
3011      str = ctx.stylize('[Getter/Setter]', 'special');
3012    } else {
3013      str = ctx.stylize('[Getter]', 'special');
3014    }
3015  } else {
3016    if (desc.set) {
3017      str = ctx.stylize('[Setter]', 'special');
3018    }
3019  }
3020  if (!hasOwnProperty(visibleKeys, key)) {
3021    name = '[' + key + ']';
3022  }
3023  if (!str) {
3024    if (ctx.seen.indexOf(desc.value) < 0) {
3025      if (isNull(recurseTimes)) {
3026        str = formatValue(ctx, desc.value, null);
3027      } else {
3028        str = formatValue(ctx, desc.value, recurseTimes - 1);
3029      }
3030      if (str.indexOf('\n') > -1) {
3031        if (array) {
3032          str = str.split('\n').map(function(line) {
3033            return '  ' + line;
3034          }).join('\n').substr(2);
3035        } else {
3036          str = '\n' + str.split('\n').map(function(line) {
3037            return '   ' + line;
3038          }).join('\n');
3039        }
3040      }
3041    } else {
3042      str = ctx.stylize('[Circular]', 'special');
3043    }
3044  }
3045  if (isUndefined(name)) {
3046    if (array && key.match(/^\d+$/)) {
3047      return str;
3048    }
3049    name = JSON.stringify('' + key);
3050    if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
3051      name = name.substr(1, name.length - 2);
3052      name = ctx.stylize(name, 'name');
3053    } else {
3054      name = name.replace(/'/g, "\\'")
3055                 .replace(/\\"/g, '"')
3056                 .replace(/(^"|"$)/g, "'");
3057      name = ctx.stylize(name, 'string');
3058    }
3059  }
3060
3061  return name + ': ' + str;
3062}
3063
3064
3065function reduceToSingleString(output, base, braces) {
3066  var numLinesEst = 0;
3067  var length = output.reduce(function(prev, cur) {
3068    numLinesEst++;
3069    if (cur.indexOf('\n') >= 0) numLinesEst++;
3070    return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
3071  }, 0);
3072
3073  if (length > 60) {
3074    return braces[0] +
3075           (base === '' ? '' : base + '\n ') +
3076           ' ' +
3077           output.join(',\n  ') +
3078           ' ' +
3079           braces[1];
3080  }
3081
3082  return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
3083}
3084
3085
3086// NOTE: These type checking functions intentionally don't use `instanceof`
3087// because it is fragile and can be easily faked with `Object.create()`.
3088function isArray(ar) {
3089  return Array.isArray(ar);
3090}
3091exports.isArray = isArray;
3092
3093function isBoolean(arg) {
3094  return typeof arg === 'boolean';
3095}
3096exports.isBoolean = isBoolean;
3097
3098function isNull(arg) {
3099  return arg === null;
3100}
3101exports.isNull = isNull;
3102
3103function isNullOrUndefined(arg) {
3104  return arg == null;
3105}
3106exports.isNullOrUndefined = isNullOrUndefined;
3107
3108function isNumber(arg) {
3109  return typeof arg === 'number';
3110}
3111exports.isNumber = isNumber;
3112
3113function isString(arg) {
3114  return typeof arg === 'string';
3115}
3116exports.isString = isString;
3117
3118function isSymbol(arg) {
3119  return typeof arg === 'symbol';
3120}
3121exports.isSymbol = isSymbol;
3122
3123function isUndefined(arg) {
3124  return arg === void 0;
3125}
3126exports.isUndefined = isUndefined;
3127
3128function isRegExp(re) {
3129  return isObject(re) && objectToString(re) === '[object RegExp]';
3130}
3131exports.isRegExp = isRegExp;
3132
3133function isObject(arg) {
3134  return typeof arg === 'object' && arg !== null;
3135}
3136exports.isObject = isObject;
3137
3138function isDate(d) {
3139  return isObject(d) && objectToString(d) === '[object Date]';
3140}
3141exports.isDate = isDate;
3142
3143function isError(e) {
3144  return isObject(e) &&
3145      (objectToString(e) === '[object Error]' || e instanceof Error);
3146}
3147exports.isError = isError;
3148
3149function isFunction(arg) {
3150  return typeof arg === 'function';
3151}
3152exports.isFunction = isFunction;
3153
3154function isPrimitive(arg) {
3155  return arg === null ||
3156         typeof arg === 'boolean' ||
3157         typeof arg === 'number' ||
3158         typeof arg === 'string' ||
3159         typeof arg === 'symbol' ||  // ES6 symbol
3160         typeof arg === 'undefined';
3161}
3162exports.isPrimitive = isPrimitive;
3163
3164exports.isBuffer = require('./support/isBuffer');
3165
3166function objectToString(o) {
3167  return Object.prototype.toString.call(o);
3168}
3169
3170
3171function pad(n) {
3172  return n < 10 ? '0' + n.toString(10) : n.toString(10);
3173}
3174
3175
3176var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
3177              'Oct', 'Nov', 'Dec'];
3178
3179// 26 Feb 16:19:34
3180function timestamp() {
3181  var d = new Date();
3182  var time = [pad(d.getHours()),
3183              pad(d.getMinutes()),
3184              pad(d.getSeconds())].join(':');
3185  return [d.getDate(), months[d.getMonth()], time].join(' ');
3186}
3187
3188
3189// log is just a thin wrapper to console.log that prepends a timestamp
3190exports.log = function() {
3191  console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
3192};
3193
3194
3195/**
3196 * Inherit the prototype methods from one constructor into another.
3197 *
3198 * The Function.prototype.inherits from lang.js rewritten as a standalone
3199 * function (not on Function.prototype). NOTE: If this file is to be loaded
3200 * during bootstrapping this function needs to be rewritten using some native
3201 * functions as prototype setup using normal JavaScript does not work as
3202 * expected during bootstrapping (see mirror.js in r114903).
3203 *
3204 * @param {function} ctor Constructor function which needs to inherit the
3205 *     prototype.
3206 * @param {function} superCtor Constructor function to inherit prototype from.
3207 */
3208exports.inherits = require('inherits');
3209
3210exports._extend = function(origin, add) {
3211  // Don't do anything if add isn't an object
3212  if (!add || !isObject(add)) return origin;
3213
3214  var keys = Object.keys(add);
3215  var i = keys.length;
3216  while (i--) {
3217    origin[keys[i]] = add[keys[i]];
3218  }
3219  return origin;
3220};
3221
3222function hasOwnProperty(obj, prop) {
3223  return Object.prototype.hasOwnProperty.call(obj, prop);
3224}
3225
3226}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
3227},{"./support/isBuffer":7,"_process":12,"inherits":6}],9:[function(require,module,exports){
3228'use strict'
3229
3230exports.byteLength = byteLength
3231exports.toByteArray = toByteArray
3232exports.fromByteArray = fromByteArray
3233
3234var lookup = []
3235var revLookup = []
3236var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
3237
3238var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
3239for (var i = 0, len = code.length; i < len; ++i) {
3240  lookup[i] = code[i]
3241  revLookup[code.charCodeAt(i)] = i
3242}
3243
3244// Support decoding URL-safe base64 strings, as Node.js does.
3245// See: https://en.wikipedia.org/wiki/Base64#URL_applications
3246revLookup['-'.charCodeAt(0)] = 62
3247revLookup['_'.charCodeAt(0)] = 63
3248
3249function getLens (b64) {
3250  var len = b64.length
3251
3252  if (len % 4 > 0) {
3253    throw new Error('Invalid string. Length must be a multiple of 4')
3254  }
3255
3256  // Trim off extra bytes after placeholder bytes are found
3257  // See: https://github.com/beatgammit/base64-js/issues/42
3258  var validLen = b64.indexOf('=')
3259  if (validLen === -1) validLen = len
3260
3261  var placeHoldersLen = validLen === len
3262    ? 0
3263    : 4 - (validLen % 4)
3264
3265  return [validLen, placeHoldersLen]
3266}
3267
3268// base64 is 4/3 + up to two characters of the original data
3269function byteLength (b64) {
3270  var lens = getLens(b64)
3271  var validLen = lens[0]
3272  var placeHoldersLen = lens[1]
3273  return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
3274}
3275
3276function _byteLength (b64, validLen, placeHoldersLen) {
3277  return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
3278}
3279
3280function toByteArray (b64) {
3281  var tmp
3282  var lens = getLens(b64)
3283  var validLen = lens[0]
3284  var placeHoldersLen = lens[1]
3285
3286  var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
3287
3288  var curByte = 0
3289
3290  // if there are placeholders, only get up to the last complete 4 chars
3291  var len = placeHoldersLen > 0
3292    ? validLen - 4
3293    : validLen
3294
3295  for (var i = 0; i < len; i += 4) {
3296    tmp =
3297      (revLookup[b64.charCodeAt(i)] << 18) |
3298      (revLookup[b64.charCodeAt(i + 1)] << 12) |
3299      (revLookup[b64.charCodeAt(i + 2)] << 6) |
3300      revLookup[b64.charCodeAt(i + 3)]
3301    arr[curByte++] = (tmp >> 16) & 0xFF
3302    arr[curByte++] = (tmp >> 8) & 0xFF
3303    arr[curByte++] = tmp & 0xFF
3304  }
3305
3306  if (placeHoldersLen === 2) {
3307    tmp =
3308      (revLookup[b64.charCodeAt(i)] << 2) |
3309      (revLookup[b64.charCodeAt(i + 1)] >> 4)
3310    arr[curByte++] = tmp & 0xFF
3311  }
3312
3313  if (placeHoldersLen === 1) {
3314    tmp =
3315      (revLookup[b64.charCodeAt(i)] << 10) |
3316      (revLookup[b64.charCodeAt(i + 1)] << 4) |
3317      (revLookup[b64.charCodeAt(i + 2)] >> 2)
3318    arr[curByte++] = (tmp >> 8) & 0xFF
3319    arr[curByte++] = tmp & 0xFF
3320  }
3321
3322  return arr
3323}
3324
3325function tripletToBase64 (num) {
3326  return lookup[num >> 18 & 0x3F] +
3327    lookup[num >> 12 & 0x3F] +
3328    lookup[num >> 6 & 0x3F] +
3329    lookup[num & 0x3F]
3330}
3331
3332function encodeChunk (uint8, start, end) {
3333  var tmp
3334  var output = []
3335  for (var i = start; i < end; i += 3) {
3336    tmp =
3337      ((uint8[i] << 16) & 0xFF0000) +
3338      ((uint8[i + 1] << 8) & 0xFF00) +
3339      (uint8[i + 2] & 0xFF)
3340    output.push(tripletToBase64(tmp))
3341  }
3342  return output.join('')
3343}
3344
3345function fromByteArray (uint8) {
3346  var tmp
3347  var len = uint8.length
3348  var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
3349  var parts = []
3350  var maxChunkLength = 16383 // must be multiple of 3
3351
3352  // go through the array every three bytes, we'll deal with trailing stuff later
3353  for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
3354    parts.push(encodeChunk(
3355      uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
3356    ))
3357  }
3358
3359  // pad the end with zeros, but make sure to not forget the extra bytes
3360  if (extraBytes === 1) {
3361    tmp = uint8[len - 1]
3362    parts.push(
3363      lookup[tmp >> 2] +
3364      lookup[(tmp << 4) & 0x3F] +
3365      '=='
3366    )
3367  } else if (extraBytes === 2) {
3368    tmp = (uint8[len - 2] << 8) + uint8[len - 1]
3369    parts.push(
3370      lookup[tmp >> 10] +
3371      lookup[(tmp >> 4) & 0x3F] +
3372      lookup[(tmp << 2) & 0x3F] +
3373      '='
3374    )
3375  }
3376
3377  return parts.join('')
3378}
3379
3380},{}],10:[function(require,module,exports){
3381(function (Buffer){
3382/*!
3383 * The buffer module from node.js, for the browser.
3384 *
3385 * @author   Feross Aboukhadijeh <https://feross.org>
3386 * @license  MIT
3387 */
3388/* eslint-disable no-proto */
3389
3390'use strict'
3391
3392var base64 = require('base64-js')
3393var ieee754 = require('ieee754')
3394
3395exports.Buffer = Buffer
3396exports.SlowBuffer = SlowBuffer
3397exports.INSPECT_MAX_BYTES = 50
3398
3399var K_MAX_LENGTH = 0x7fffffff
3400exports.kMaxLength = K_MAX_LENGTH
3401
3402/**
3403 * If `Buffer.TYPED_ARRAY_SUPPORT`:
3404 *   === true    Use Uint8Array implementation (fastest)
3405 *   === false   Print warning and recommend using `buffer` v4.x which has an Object
3406 *               implementation (most compatible, even IE6)
3407 *
3408 * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
3409 * Opera 11.6+, iOS 4.2+.
3410 *
3411 * We report that the browser does not support typed arrays if the are not subclassable
3412 * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
3413 * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
3414 * for __proto__ and has a buggy typed array implementation.
3415 */
3416Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport()
3417
3418if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&
3419    typeof console.error === 'function') {
3420  console.error(
3421    'This browser lacks typed array (Uint8Array) support which is required by ' +
3422    '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'
3423  )
3424}
3425
3426function typedArraySupport () {
3427  // Can typed array instances can be augmented?
3428  try {
3429    var arr = new Uint8Array(1)
3430    arr.__proto__ = { __proto__: Uint8Array.prototype, foo: function () { return 42 } }
3431    return arr.foo() === 42
3432  } catch (e) {
3433    return false
3434  }
3435}
3436
3437Object.defineProperty(Buffer.prototype, 'parent', {
3438  enumerable: true,
3439  get: function () {
3440    if (!Buffer.isBuffer(this)) return undefined
3441    return this.buffer
3442  }
3443})
3444
3445Object.defineProperty(Buffer.prototype, 'offset', {
3446  enumerable: true,
3447  get: function () {
3448    if (!Buffer.isBuffer(this)) return undefined
3449    return this.byteOffset
3450  }
3451})
3452
3453function createBuffer (length) {
3454  if (length > K_MAX_LENGTH) {
3455    throw new RangeError('The value "' + length + '" is invalid for option "size"')
3456  }
3457  // Return an augmented `Uint8Array` instance
3458  var buf = new Uint8Array(length)
3459  buf.__proto__ = Buffer.prototype
3460  return buf
3461}
3462
3463/**
3464 * The Buffer constructor returns instances of `Uint8Array` that have their
3465 * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
3466 * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
3467 * and the `Uint8Array` methods. Square bracket notation works as expected -- it
3468 * returns a single octet.
3469 *
3470 * The `Uint8Array` prototype remains unmodified.
3471 */
3472
3473function Buffer (arg, encodingOrOffset, length) {
3474  // Common case.
3475  if (typeof arg === 'number') {
3476    if (typeof encodingOrOffset === 'string') {
3477      throw new TypeError(
3478        'The "string" argument must be of type string. Received type number'
3479      )
3480    }
3481    return allocUnsafe(arg)
3482  }
3483  return from(arg, encodingOrOffset, length)
3484}
3485
3486// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
3487if (typeof Symbol !== 'undefined' && Symbol.species != null &&
3488    Buffer[Symbol.species] === Buffer) {
3489  Object.defineProperty(Buffer, Symbol.species, {
3490    value: null,
3491    configurable: true,
3492    enumerable: false,
3493    writable: false
3494  })
3495}
3496
3497Buffer.poolSize = 8192 // not used by this implementation
3498
3499function from (value, encodingOrOffset, length) {
3500  if (typeof value === 'string') {
3501    return fromString(value, encodingOrOffset)
3502  }
3503
3504  if (ArrayBuffer.isView(value)) {
3505    return fromArrayLike(value)
3506  }
3507
3508  if (value == null) {
3509    throw TypeError(
3510      'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
3511      'or Array-like Object. Received type ' + (typeof value)
3512    )
3513  }
3514
3515  if (isInstance(value, ArrayBuffer) ||
3516      (value && isInstance(value.buffer, ArrayBuffer))) {
3517    return fromArrayBuffer(value, encodingOrOffset, length)
3518  }
3519
3520  if (typeof value === 'number') {
3521    throw new TypeError(
3522      'The "value" argument must not be of type number. Received type number'
3523    )
3524  }
3525
3526  var valueOf = value.valueOf && value.valueOf()
3527  if (valueOf != null && valueOf !== value) {
3528    return Buffer.from(valueOf, encodingOrOffset, length)
3529  }
3530
3531  var b = fromObject(value)
3532  if (b) return b
3533
3534  if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&
3535      typeof value[Symbol.toPrimitive] === 'function') {
3536    return Buffer.from(
3537      value[Symbol.toPrimitive]('string'), encodingOrOffset, length
3538    )
3539  }
3540
3541  throw new TypeError(
3542    'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
3543    'or Array-like Object. Received type ' + (typeof value)
3544  )
3545}
3546
3547/**
3548 * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
3549 * if value is a number.
3550 * Buffer.from(str[, encoding])
3551 * Buffer.from(array)
3552 * Buffer.from(buffer)
3553 * Buffer.from(arrayBuffer[, byteOffset[, length]])
3554 **/
3555Buffer.from = function (value, encodingOrOffset, length) {
3556  return from(value, encodingOrOffset, length)
3557}
3558
3559// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
3560// https://github.com/feross/buffer/pull/148
3561Buffer.prototype.__proto__ = Uint8Array.prototype
3562Buffer.__proto__ = Uint8Array
3563
3564function assertSize (size) {
3565  if (typeof size !== 'number') {
3566    throw new TypeError('"size" argument must be of type number')
3567  } else if (size < 0) {
3568    throw new RangeError('The value "' + size + '" is invalid for option "size"')
3569  }
3570}
3571
3572function alloc (size, fill, encoding) {
3573  assertSize(size)
3574  if (size <= 0) {
3575    return createBuffer(size)
3576  }
3577  if (fill !== undefined) {
3578    // Only pay attention to encoding if it's a string. This
3579    // prevents accidentally sending in a number that would
3580    // be interpretted as a start offset.
3581    return typeof encoding === 'string'
3582      ? createBuffer(size).fill(fill, encoding)
3583      : createBuffer(size).fill(fill)
3584  }
3585  return createBuffer(size)
3586}
3587
3588/**
3589 * Creates a new filled Buffer instance.
3590 * alloc(size[, fill[, encoding]])
3591 **/
3592Buffer.alloc = function (size, fill, encoding) {
3593  return alloc(size, fill, encoding)
3594}
3595
3596function allocUnsafe (size) {
3597  assertSize(size)
3598  return createBuffer(size < 0 ? 0 : checked(size) | 0)
3599}
3600
3601/**
3602 * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
3603 * */
3604Buffer.allocUnsafe = function (size) {
3605  return allocUnsafe(size)
3606}
3607/**
3608 * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
3609 */
3610Buffer.allocUnsafeSlow = function (size) {
3611  return allocUnsafe(size)
3612}
3613
3614function fromString (string, encoding) {
3615  if (typeof encoding !== 'string' || encoding === '') {
3616    encoding = 'utf8'
3617  }
3618
3619  if (!Buffer.isEncoding(encoding)) {
3620    throw new TypeError('Unknown encoding: ' + encoding)
3621  }
3622
3623  var length = byteLength(string, encoding) | 0
3624  var buf = createBuffer(length)
3625
3626  var actual = buf.write(string, encoding)
3627
3628  if (actual !== length) {
3629    // Writing a hex string, for example, that contains invalid characters will
3630    // cause everything after the first invalid character to be ignored. (e.g.
3631    // 'abxxcd' will be treated as 'ab')
3632    buf = buf.slice(0, actual)
3633  }
3634
3635  return buf
3636}
3637
3638function fromArrayLike (array) {
3639  var length = array.length < 0 ? 0 : checked(array.length) | 0
3640  var buf = createBuffer(length)
3641  for (var i = 0; i < length; i += 1) {
3642    buf[i] = array[i] & 255
3643  }
3644  return buf
3645}
3646
3647function fromArrayBuffer (array, byteOffset, length) {
3648  if (byteOffset < 0 || array.byteLength < byteOffset) {
3649    throw new RangeError('"offset" is outside of buffer bounds')
3650  }
3651
3652  if (array.byteLength < byteOffset + (length || 0)) {
3653    throw new RangeError('"length" is outside of buffer bounds')
3654  }
3655
3656  var buf
3657  if (byteOffset === undefined && length === undefined) {
3658    buf = new Uint8Array(array)
3659  } else if (length === undefined) {
3660    buf = new Uint8Array(array, byteOffset)
3661  } else {
3662    buf = new Uint8Array(array, byteOffset, length)
3663  }
3664
3665  // Return an augmented `Uint8Array` instance
3666  buf.__proto__ = Buffer.prototype
3667  return buf
3668}
3669
3670function fromObject (obj) {
3671  if (Buffer.isBuffer(obj)) {
3672    var len = checked(obj.length) | 0
3673    var buf = createBuffer(len)
3674
3675    if (buf.length === 0) {
3676      return buf
3677    }
3678
3679    obj.copy(buf, 0, 0, len)
3680    return buf
3681  }
3682
3683  if (obj.length !== undefined) {
3684    if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {
3685      return createBuffer(0)
3686    }
3687    return fromArrayLike(obj)
3688  }
3689
3690  if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
3691    return fromArrayLike(obj.data)
3692  }
3693}
3694
3695function checked (length) {
3696  // Note: cannot use `length < K_MAX_LENGTH` here because that fails when
3697  // length is NaN (which is otherwise coerced to zero.)
3698  if (length >= K_MAX_LENGTH) {
3699    throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
3700                         'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')
3701  }
3702  return length | 0
3703}
3704
3705function SlowBuffer (length) {
3706  if (+length != length) { // eslint-disable-line eqeqeq
3707    length = 0
3708  }
3709  return Buffer.alloc(+length)
3710}
3711
3712Buffer.isBuffer = function isBuffer (b) {
3713  return b != null && b._isBuffer === true &&
3714    b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false
3715}
3716
3717Buffer.compare = function compare (a, b) {
3718  if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)
3719  if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)
3720  if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
3721    throw new TypeError(
3722      'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
3723    )
3724  }
3725
3726  if (a === b) return 0
3727
3728  var x = a.length
3729  var y = b.length
3730
3731  for (var i = 0, len = Math.min(x, y); i < len; ++i) {
3732    if (a[i] !== b[i]) {
3733      x = a[i]
3734      y = b[i]
3735      break
3736    }
3737  }
3738
3739  if (x < y) return -1
3740  if (y < x) return 1
3741  return 0
3742}
3743
3744Buffer.isEncoding = function isEncoding (encoding) {
3745  switch (String(encoding).toLowerCase()) {
3746    case 'hex':
3747    case 'utf8':
3748    case 'utf-8':
3749    case 'ascii':
3750    case 'latin1':
3751    case 'binary':
3752    case 'base64':
3753    case 'ucs2':
3754    case 'ucs-2':
3755    case 'utf16le':
3756    case 'utf-16le':
3757      return true
3758    default:
3759      return false
3760  }
3761}
3762
3763Buffer.concat = function concat (list, length) {
3764  if (!Array.isArray(list)) {
3765    throw new TypeError('"list" argument must be an Array of Buffers')
3766  }
3767
3768  if (list.length === 0) {
3769    return Buffer.alloc(0)
3770  }
3771
3772  var i
3773  if (length === undefined) {
3774    length = 0
3775    for (i = 0; i < list.length; ++i) {
3776      length += list[i].length
3777    }
3778  }
3779
3780  var buffer = Buffer.allocUnsafe(length)
3781  var pos = 0
3782  for (i = 0; i < list.length; ++i) {
3783    var buf = list[i]
3784    if (isInstance(buf, Uint8Array)) {
3785      buf = Buffer.from(buf)
3786    }
3787    if (!Buffer.isBuffer(buf)) {
3788      throw new TypeError('"list" argument must be an Array of Buffers')
3789    }
3790    buf.copy(buffer, pos)
3791    pos += buf.length
3792  }
3793  return buffer
3794}
3795
3796function byteLength (string, encoding) {
3797  if (Buffer.isBuffer(string)) {
3798    return string.length
3799  }
3800  if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {
3801    return string.byteLength
3802  }
3803  if (typeof string !== 'string') {
3804    throw new TypeError(
3805      'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' +
3806      'Received type ' + typeof string
3807    )
3808  }
3809
3810  var len = string.length
3811  var mustMatch = (arguments.length > 2 && arguments[2] === true)
3812  if (!mustMatch && len === 0) return 0
3813
3814  // Use a for loop to avoid recursion
3815  var loweredCase = false
3816  for (;;) {
3817    switch (encoding) {
3818      case 'ascii':
3819      case 'latin1':
3820      case 'binary':
3821        return len
3822      case 'utf8':
3823      case 'utf-8':
3824        return utf8ToBytes(string).length
3825      case 'ucs2':
3826      case 'ucs-2':
3827      case 'utf16le':
3828      case 'utf-16le':
3829        return len * 2
3830      case 'hex':
3831        return len >>> 1
3832      case 'base64':
3833        return base64ToBytes(string).length
3834      default:
3835        if (loweredCase) {
3836          return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8
3837        }
3838        encoding = ('' + encoding).toLowerCase()
3839        loweredCase = true
3840    }
3841  }
3842}
3843Buffer.byteLength = byteLength
3844
3845function slowToString (encoding, start, end) {
3846  var loweredCase = false
3847
3848  // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
3849  // property of a typed array.
3850
3851  // This behaves neither like String nor Uint8Array in that we set start/end
3852  // to their upper/lower bounds if the value passed is out of range.
3853  // undefined is handled specially as per ECMA-262 6th Edition,
3854  // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
3855  if (start === undefined || start < 0) {
3856    start = 0
3857  }
3858  // Return early if start > this.length. Done here to prevent potential uint32
3859  // coercion fail below.
3860  if (start > this.length) {
3861    return ''
3862  }
3863
3864  if (end === undefined || end > this.length) {
3865    end = this.length
3866  }
3867
3868  if (end <= 0) {
3869    return ''
3870  }
3871
3872  // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
3873  end >>>= 0
3874  start >>>= 0
3875
3876  if (end <= start) {
3877    return ''
3878  }
3879
3880  if (!encoding) encoding = 'utf8'
3881
3882  while (true) {
3883    switch (encoding) {
3884      case 'hex':
3885        return hexSlice(this, start, end)
3886
3887      case 'utf8':
3888      case 'utf-8':
3889        return utf8Slice(this, start, end)
3890
3891      case 'ascii':
3892        return asciiSlice(this, start, end)
3893
3894      case 'latin1':
3895      case 'binary':
3896        return latin1Slice(this, start, end)
3897
3898      case 'base64':
3899        return base64Slice(this, start, end)
3900
3901      case 'ucs2':
3902      case 'ucs-2':
3903      case 'utf16le':
3904      case 'utf-16le':
3905        return utf16leSlice(this, start, end)
3906
3907      default:
3908        if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
3909        encoding = (encoding + '').toLowerCase()
3910        loweredCase = true
3911    }
3912  }
3913}
3914
3915// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)
3916// to detect a Buffer instance. It's not possible to use `instanceof Buffer`
3917// reliably in a browserify context because there could be multiple different
3918// copies of the 'buffer' package in use. This method works even for Buffer
3919// instances that were created from another copy of the `buffer` package.
3920// See: https://github.com/feross/buffer/issues/154
3921Buffer.prototype._isBuffer = true
3922
3923function swap (b, n, m) {
3924  var i = b[n]
3925  b[n] = b[m]
3926  b[m] = i
3927}
3928
3929Buffer.prototype.swap16 = function swap16 () {
3930  var len = this.length
3931  if (len % 2 !== 0) {
3932    throw new RangeError('Buffer size must be a multiple of 16-bits')
3933  }
3934  for (var i = 0; i < len; i += 2) {
3935    swap(this, i, i + 1)
3936  }
3937  return this
3938}
3939
3940Buffer.prototype.swap32 = function swap32 () {
3941  var len = this.length
3942  if (len % 4 !== 0) {
3943    throw new RangeError('Buffer size must be a multiple of 32-bits')
3944  }
3945  for (var i = 0; i < len; i += 4) {
3946    swap(this, i, i + 3)
3947    swap(this, i + 1, i + 2)
3948  }
3949  return this
3950}
3951
3952Buffer.prototype.swap64 = function swap64 () {
3953  var len = this.length
3954  if (len % 8 !== 0) {
3955    throw new RangeError('Buffer size must be a multiple of 64-bits')
3956  }
3957  for (var i = 0; i < len; i += 8) {
3958    swap(this, i, i + 7)
3959    swap(this, i + 1, i + 6)
3960    swap(this, i + 2, i + 5)
3961    swap(this, i + 3, i + 4)
3962  }
3963  return this
3964}
3965
3966Buffer.prototype.toString = function toString () {
3967  var length = this.length
3968  if (length === 0) return ''
3969  if (arguments.length === 0) return utf8Slice(this, 0, length)
3970  return slowToString.apply(this, arguments)
3971}
3972
3973Buffer.prototype.toLocaleString = Buffer.prototype.toString
3974
3975Buffer.prototype.equals = function equals (b) {
3976  if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
3977  if (this === b) return true
3978  return Buffer.compare(this, b) === 0
3979}
3980
3981Buffer.prototype.inspect = function inspect () {
3982  var str = ''
3983  var max = exports.INSPECT_MAX_BYTES
3984  str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()
3985  if (this.length > max) str += ' ... '
3986  return '<Buffer ' + str + '>'
3987}
3988
3989Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
3990  if (isInstance(target, Uint8Array)) {
3991    target = Buffer.from(target, target.offset, target.byteLength)
3992  }
3993  if (!Buffer.isBuffer(target)) {
3994    throw new TypeError(
3995      'The "target" argument must be one of type Buffer or Uint8Array. ' +
3996      'Received type ' + (typeof target)
3997    )
3998  }
3999
4000  if (start === undefined) {
4001    start = 0
4002  }
4003  if (end === undefined) {
4004    end = target ? target.length : 0
4005  }
4006  if (thisStart === undefined) {
4007    thisStart = 0
4008  }
4009  if (thisEnd === undefined) {
4010    thisEnd = this.length
4011  }
4012
4013  if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
4014    throw new RangeError('out of range index')
4015  }
4016
4017  if (thisStart >= thisEnd && start >= end) {
4018    return 0
4019  }
4020  if (thisStart >= thisEnd) {
4021    return -1
4022  }
4023  if (start >= end) {
4024    return 1
4025  }
4026
4027  start >>>= 0
4028  end >>>= 0
4029  thisStart >>>= 0
4030  thisEnd >>>= 0
4031
4032  if (this === target) return 0
4033
4034  var x = thisEnd - thisStart
4035  var y = end - start
4036  var len = Math.min(x, y)
4037
4038  var thisCopy = this.slice(thisStart, thisEnd)
4039  var targetCopy = target.slice(start, end)
4040
4041  for (var i = 0; i < len; ++i) {
4042    if (thisCopy[i] !== targetCopy[i]) {
4043      x = thisCopy[i]
4044      y = targetCopy[i]
4045      break
4046    }
4047  }
4048
4049  if (x < y) return -1
4050  if (y < x) return 1
4051  return 0
4052}
4053
4054// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
4055// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
4056//
4057// Arguments:
4058// - buffer - a Buffer to search
4059// - val - a string, Buffer, or number
4060// - byteOffset - an index into `buffer`; will be clamped to an int32
4061// - encoding - an optional encoding, relevant is val is a string
4062// - dir - true for indexOf, false for lastIndexOf
4063function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
4064  // Empty buffer means no match
4065  if (buffer.length === 0) return -1
4066
4067  // Normalize byteOffset
4068  if (typeof byteOffset === 'string') {
4069    encoding = byteOffset
4070    byteOffset = 0
4071  } else if (byteOffset > 0x7fffffff) {
4072    byteOffset = 0x7fffffff
4073  } else if (byteOffset < -0x80000000) {
4074    byteOffset = -0x80000000
4075  }
4076  byteOffset = +byteOffset // Coerce to Number.
4077  if (numberIsNaN(byteOffset)) {
4078    // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
4079    byteOffset = dir ? 0 : (buffer.length - 1)
4080  }
4081
4082  // Normalize byteOffset: negative offsets start from the end of the buffer
4083  if (byteOffset < 0) byteOffset = buffer.length + byteOffset
4084  if (byteOffset >= buffer.length) {
4085    if (dir) return -1
4086    else byteOffset = buffer.length - 1
4087  } else if (byteOffset < 0) {
4088    if (dir) byteOffset = 0
4089    else return -1
4090  }
4091
4092  // Normalize val
4093  if (typeof val === 'string') {
4094    val = Buffer.from(val, encoding)
4095  }
4096
4097  // Finally, search either indexOf (if dir is true) or lastIndexOf
4098  if (Buffer.isBuffer(val)) {
4099    // Special case: looking for empty string/buffer always fails
4100    if (val.length === 0) {
4101      return -1
4102    }
4103    return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
4104  } else if (typeof val === 'number') {
4105    val = val & 0xFF // Search for a byte value [0-255]
4106    if (typeof Uint8Array.prototype.indexOf === 'function') {
4107      if (dir) {
4108        return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
4109      } else {
4110        return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
4111      }
4112    }
4113    return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
4114  }
4115
4116  throw new TypeError('val must be string, number or Buffer')
4117}
4118
4119function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
4120  var indexSize = 1
4121  var arrLength = arr.length
4122  var valLength = val.length
4123
4124  if (encoding !== undefined) {
4125    encoding = String(encoding).toLowerCase()
4126    if (encoding === 'ucs2' || encoding === 'ucs-2' ||
4127        encoding === 'utf16le' || encoding === 'utf-16le') {
4128      if (arr.length < 2 || val.length < 2) {
4129        return -1
4130      }
4131      indexSize = 2
4132      arrLength /= 2
4133      valLength /= 2
4134      byteOffset /= 2
4135    }
4136  }
4137
4138  function read (buf, i) {
4139    if (indexSize === 1) {
4140      return buf[i]
4141    } else {
4142      return buf.readUInt16BE(i * indexSize)
4143    }
4144  }
4145
4146  var i
4147  if (dir) {
4148    var foundIndex = -1
4149    for (i = byteOffset; i < arrLength; i++) {
4150      if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
4151        if (foundIndex === -1) foundIndex = i
4152        if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
4153      } else {
4154        if (foundIndex !== -1) i -= i - foundIndex
4155        foundIndex = -1
4156      }
4157    }
4158  } else {
4159    if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
4160    for (i = byteOffset; i >= 0; i--) {
4161      var found = true
4162      for (var j = 0; j < valLength; j++) {
4163        if (read(arr, i + j) !== read(val, j)) {
4164          found = false
4165          break
4166        }
4167      }
4168      if (found) return i
4169    }
4170  }
4171
4172  return -1
4173}
4174
4175Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
4176  return this.indexOf(val, byteOffset, encoding) !== -1
4177}
4178
4179Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
4180  return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
4181}
4182
4183Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
4184  return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
4185}
4186
4187function hexWrite (buf, string, offset, length) {
4188  offset = Number(offset) || 0
4189  var remaining = buf.length - offset
4190  if (!length) {
4191    length = remaining
4192  } else {
4193    length = Number(length)
4194    if (length > remaining) {
4195      length = remaining
4196    }
4197  }
4198
4199  var strLen = string.length
4200
4201  if (length > strLen / 2) {
4202    length = strLen / 2
4203  }
4204  for (var i = 0; i < length; ++i) {
4205    var parsed = parseInt(string.substr(i * 2, 2), 16)
4206    if (numberIsNaN(parsed)) return i
4207    buf[offset + i] = parsed
4208  }
4209  return i
4210}
4211
4212function utf8Write (buf, string, offset, length) {
4213  return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
4214}
4215
4216function asciiWrite (buf, string, offset, length) {
4217  return blitBuffer(asciiToBytes(string), buf, offset, length)
4218}
4219
4220function latin1Write (buf, string, offset, length) {
4221  return asciiWrite(buf, string, offset, length)
4222}
4223
4224function base64Write (buf, string, offset, length) {
4225  return blitBuffer(base64ToBytes(string), buf, offset, length)
4226}
4227
4228function ucs2Write (buf, string, offset, length) {
4229  return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
4230}
4231
4232Buffer.prototype.write = function write (string, offset, length, encoding) {
4233  // Buffer#write(string)
4234  if (offset === undefined) {
4235    encoding = 'utf8'
4236    length = this.length
4237    offset = 0
4238  // Buffer#write(string, encoding)
4239  } else if (length === undefined && typeof offset === 'string') {
4240    encoding = offset
4241    length = this.length
4242    offset = 0
4243  // Buffer#write(string, offset[, length][, encoding])
4244  } else if (isFinite(offset)) {
4245    offset = offset >>> 0
4246    if (isFinite(length)) {
4247      length = length >>> 0
4248      if (encoding === undefined) encoding = 'utf8'
4249    } else {
4250      encoding = length
4251      length = undefined
4252    }
4253  } else {
4254    throw new Error(
4255      'Buffer.write(string, encoding, offset[, length]) is no longer supported'
4256    )
4257  }
4258
4259  var remaining = this.length - offset
4260  if (length === undefined || length > remaining) length = remaining
4261
4262  if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
4263    throw new RangeError('Attempt to write outside buffer bounds')
4264  }
4265
4266  if (!encoding) encoding = 'utf8'
4267
4268  var loweredCase = false
4269  for (;;) {
4270    switch (encoding) {
4271      case 'hex':
4272        return hexWrite(this, string, offset, length)
4273
4274      case 'utf8':
4275      case 'utf-8':
4276        return utf8Write(this, string, offset, length)
4277
4278      case 'ascii':
4279        return asciiWrite(this, string, offset, length)
4280
4281      case 'latin1':
4282      case 'binary':
4283        return latin1Write(this, string, offset, length)
4284
4285      case 'base64':
4286        // Warning: maxLength not taken into account in base64Write
4287        return base64Write(this, string, offset, length)
4288
4289      case 'ucs2':
4290      case 'ucs-2':
4291      case 'utf16le':
4292      case 'utf-16le':
4293        return ucs2Write(this, string, offset, length)
4294
4295      default:
4296        if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
4297        encoding = ('' + encoding).toLowerCase()
4298        loweredCase = true
4299    }
4300  }
4301}
4302
4303Buffer.prototype.toJSON = function toJSON () {
4304  return {
4305    type: 'Buffer',
4306    data: Array.prototype.slice.call(this._arr || this, 0)
4307  }
4308}
4309
4310function base64Slice (buf, start, end) {
4311  if (start === 0 && end === buf.length) {
4312    return base64.fromByteArray(buf)
4313  } else {
4314    return base64.fromByteArray(buf.slice(start, end))
4315  }
4316}
4317
4318function utf8Slice (buf, start, end) {
4319  end = Math.min(buf.length, end)
4320  var res = []
4321
4322  var i = start
4323  while (i < end) {
4324    var firstByte = buf[i]
4325    var codePoint = null
4326    var bytesPerSequence = (firstByte > 0xEF) ? 4
4327      : (firstByte > 0xDF) ? 3
4328        : (firstByte > 0xBF) ? 2
4329          : 1
4330
4331    if (i + bytesPerSequence <= end) {
4332      var secondByte, thirdByte, fourthByte, tempCodePoint
4333
4334      switch (bytesPerSequence) {
4335        case 1:
4336          if (firstByte < 0x80) {
4337            codePoint = firstByte
4338          }
4339          break
4340        case 2:
4341          secondByte = buf[i + 1]
4342          if ((secondByte & 0xC0) === 0x80) {
4343            tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
4344            if (tempCodePoint > 0x7F) {
4345              codePoint = tempCodePoint
4346            }
4347          }
4348          break
4349        case 3:
4350          secondByte = buf[i + 1]
4351          thirdByte = buf[i + 2]
4352          if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
4353            tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
4354            if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
4355              codePoint = tempCodePoint
4356            }
4357          }
4358          break
4359        case 4:
4360          secondByte = buf[i + 1]
4361          thirdByte = buf[i + 2]
4362          fourthByte = buf[i + 3]
4363          if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
4364            tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
4365            if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
4366              codePoint = tempCodePoint
4367            }
4368          }
4369      }
4370    }
4371
4372    if (codePoint === null) {
4373      // we did not generate a valid codePoint so insert a
4374      // replacement char (U+FFFD) and advance only 1 byte
4375      codePoint = 0xFFFD
4376      bytesPerSequence = 1
4377    } else if (codePoint > 0xFFFF) {
4378      // encode to utf16 (surrogate pair dance)
4379      codePoint -= 0x10000
4380      res.push(codePoint >>> 10 & 0x3FF | 0xD800)
4381      codePoint = 0xDC00 | codePoint & 0x3FF
4382    }
4383
4384    res.push(codePoint)
4385    i += bytesPerSequence
4386  }
4387
4388  return decodeCodePointsArray(res)
4389}
4390
4391// Based on http://stackoverflow.com/a/22747272/680742, the browser with
4392// the lowest limit is Chrome, with 0x10000 args.
4393// We go 1 magnitude less, for safety
4394var MAX_ARGUMENTS_LENGTH = 0x1000
4395
4396function decodeCodePointsArray (codePoints) {
4397  var len = codePoints.length
4398  if (len <= MAX_ARGUMENTS_LENGTH) {
4399    return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
4400  }
4401
4402  // Decode in chunks to avoid "call stack size exceeded".
4403  var res = ''
4404  var i = 0
4405  while (i < len) {
4406    res += String.fromCharCode.apply(
4407      String,
4408      codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
4409    )
4410  }
4411  return res
4412}
4413
4414function asciiSlice (buf, start, end) {
4415  var ret = ''
4416  end = Math.min(buf.length, end)
4417
4418  for (var i = start; i < end; ++i) {
4419    ret += String.fromCharCode(buf[i] & 0x7F)
4420  }
4421  return ret
4422}
4423
4424function latin1Slice (buf, start, end) {
4425  var ret = ''
4426  end = Math.min(buf.length, end)
4427
4428  for (var i = start; i < end; ++i) {
4429    ret += String.fromCharCode(buf[i])
4430  }
4431  return ret
4432}
4433
4434function hexSlice (buf, start, end) {
4435  var len = buf.length
4436
4437  if (!start || start < 0) start = 0
4438  if (!end || end < 0 || end > len) end = len
4439
4440  var out = ''
4441  for (var i = start; i < end; ++i) {
4442    out += toHex(buf[i])
4443  }
4444  return out
4445}
4446
4447function utf16leSlice (buf, start, end) {
4448  var bytes = buf.slice(start, end)
4449  var res = ''
4450  for (var i = 0; i < bytes.length; i += 2) {
4451    res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))
4452  }
4453  return res
4454}
4455
4456Buffer.prototype.slice = function slice (start, end) {
4457  var len = this.length
4458  start = ~~start
4459  end = end === undefined ? len : ~~end
4460
4461  if (start < 0) {
4462    start += len
4463    if (start < 0) start = 0
4464  } else if (start > len) {
4465    start = len
4466  }
4467
4468  if (end < 0) {
4469    end += len
4470    if (end < 0) end = 0
4471  } else if (end > len) {
4472    end = len
4473  }
4474
4475  if (end < start) end = start
4476
4477  var newBuf = this.subarray(start, end)
4478  // Return an augmented `Uint8Array` instance
4479  newBuf.__proto__ = Buffer.prototype
4480  return newBuf
4481}
4482
4483/*
4484 * Need to make sure that buffer isn't trying to write out of bounds.
4485 */
4486function checkOffset (offset, ext, length) {
4487  if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
4488  if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
4489}
4490
4491Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
4492  offset = offset >>> 0
4493  byteLength = byteLength >>> 0
4494  if (!noAssert) checkOffset(offset, byteLength, this.length)
4495
4496  var val = this[offset]
4497  var mul = 1
4498  var i = 0
4499  while (++i < byteLength && (mul *= 0x100)) {
4500    val += this[offset + i] * mul
4501  }
4502
4503  return val
4504}
4505
4506Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
4507  offset = offset >>> 0
4508  byteLength = byteLength >>> 0
4509  if (!noAssert) {
4510    checkOffset(offset, byteLength, this.length)
4511  }
4512
4513  var val = this[offset + --byteLength]
4514  var mul = 1
4515  while (byteLength > 0 && (mul *= 0x100)) {
4516    val += this[offset + --byteLength] * mul
4517  }
4518
4519  return val
4520}
4521
4522Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
4523  offset = offset >>> 0
4524  if (!noAssert) checkOffset(offset, 1, this.length)
4525  return this[offset]
4526}
4527
4528Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
4529  offset = offset >>> 0
4530  if (!noAssert) checkOffset(offset, 2, this.length)
4531  return this[offset] | (this[offset + 1] << 8)
4532}
4533
4534Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
4535  offset = offset >>> 0
4536  if (!noAssert) checkOffset(offset, 2, this.length)
4537  return (this[offset] << 8) | this[offset + 1]
4538}
4539
4540Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
4541  offset = offset >>> 0
4542  if (!noAssert) checkOffset(offset, 4, this.length)
4543
4544  return ((this[offset]) |
4545      (this[offset + 1] << 8) |
4546      (this[offset + 2] << 16)) +
4547      (this[offset + 3] * 0x1000000)
4548}
4549
4550Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
4551  offset = offset >>> 0
4552  if (!noAssert) checkOffset(offset, 4, this.length)
4553
4554  return (this[offset] * 0x1000000) +
4555    ((this[offset + 1] << 16) |
4556    (this[offset + 2] << 8) |
4557    this[offset + 3])
4558}
4559
4560Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
4561  offset = offset >>> 0
4562  byteLength = byteLength >>> 0
4563  if (!noAssert) checkOffset(offset, byteLength, this.length)
4564
4565  var val = this[offset]
4566  var mul = 1
4567  var i = 0
4568  while (++i < byteLength && (mul *= 0x100)) {
4569    val += this[offset + i] * mul
4570  }
4571  mul *= 0x80
4572
4573  if (val >= mul) val -= Math.pow(2, 8 * byteLength)
4574
4575  return val
4576}
4577
4578Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
4579  offset = offset >>> 0
4580  byteLength = byteLength >>> 0
4581  if (!noAssert) checkOffset(offset, byteLength, this.length)
4582
4583  var i = byteLength
4584  var mul = 1
4585  var val = this[offset + --i]
4586  while (i > 0 && (mul *= 0x100)) {
4587    val += this[offset + --i] * mul
4588  }
4589  mul *= 0x80
4590
4591  if (val >= mul) val -= Math.pow(2, 8 * byteLength)
4592
4593  return val
4594}
4595
4596Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
4597  offset = offset >>> 0
4598  if (!noAssert) checkOffset(offset, 1, this.length)
4599  if (!(this[offset] & 0x80)) return (this[offset])
4600  return ((0xff - this[offset] + 1) * -1)
4601}
4602
4603Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
4604  offset = offset >>> 0
4605  if (!noAssert) checkOffset(offset, 2, this.length)
4606  var val = this[offset] | (this[offset + 1] << 8)
4607  return (val & 0x8000) ? val | 0xFFFF0000 : val
4608}
4609
4610Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
4611  offset = offset >>> 0
4612  if (!noAssert) checkOffset(offset, 2, this.length)
4613  var val = this[offset + 1] | (this[offset] << 8)
4614  return (val & 0x8000) ? val | 0xFFFF0000 : val
4615}
4616
4617Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
4618  offset = offset >>> 0
4619  if (!noAssert) checkOffset(offset, 4, this.length)
4620
4621  return (this[offset]) |
4622    (this[offset + 1] << 8) |
4623    (this[offset + 2] << 16) |
4624    (this[offset + 3] << 24)
4625}
4626
4627Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
4628  offset = offset >>> 0
4629  if (!noAssert) checkOffset(offset, 4, this.length)
4630
4631  return (this[offset] << 24) |
4632    (this[offset + 1] << 16) |
4633    (this[offset + 2] << 8) |
4634    (this[offset + 3])
4635}
4636
4637Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
4638  offset = offset >>> 0
4639  if (!noAssert) checkOffset(offset, 4, this.length)
4640  return ieee754.read(this, offset, true, 23, 4)
4641}
4642
4643Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
4644  offset = offset >>> 0
4645  if (!noAssert) checkOffset(offset, 4, this.length)
4646  return ieee754.read(this, offset, false, 23, 4)
4647}
4648
4649Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
4650  offset = offset >>> 0
4651  if (!noAssert) checkOffset(offset, 8, this.length)
4652  return ieee754.read(this, offset, true, 52, 8)
4653}
4654
4655Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
4656  offset = offset >>> 0
4657  if (!noAssert) checkOffset(offset, 8, this.length)
4658  return ieee754.read(this, offset, false, 52, 8)
4659}
4660
4661function checkInt (buf, value, offset, ext, max, min) {
4662  if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
4663  if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
4664  if (offset + ext > buf.length) throw new RangeError('Index out of range')
4665}
4666
4667Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
4668  value = +value
4669  offset = offset >>> 0
4670  byteLength = byteLength >>> 0
4671  if (!noAssert) {
4672    var maxBytes = Math.pow(2, 8 * byteLength) - 1
4673    checkInt(this, value, offset, byteLength, maxBytes, 0)
4674  }
4675
4676  var mul = 1
4677  var i = 0
4678  this[offset] = value & 0xFF
4679  while (++i < byteLength && (mul *= 0x100)) {
4680    this[offset + i] = (value / mul) & 0xFF
4681  }
4682
4683  return offset + byteLength
4684}
4685
4686Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
4687  value = +value
4688  offset = offset >>> 0
4689  byteLength = byteLength >>> 0
4690  if (!noAssert) {
4691    var maxBytes = Math.pow(2, 8 * byteLength) - 1
4692    checkInt(this, value, offset, byteLength, maxBytes, 0)
4693  }
4694
4695  var i = byteLength - 1
4696  var mul = 1
4697  this[offset + i] = value & 0xFF
4698  while (--i >= 0 && (mul *= 0x100)) {
4699    this[offset + i] = (value / mul) & 0xFF
4700  }
4701
4702  return offset + byteLength
4703}
4704
4705Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
4706  value = +value
4707  offset = offset >>> 0
4708  if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
4709  this[offset] = (value & 0xff)
4710  return offset + 1
4711}
4712
4713Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
4714  value = +value
4715  offset = offset >>> 0
4716  if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
4717  this[offset] = (value & 0xff)
4718  this[offset + 1] = (value >>> 8)
4719  return offset + 2
4720}
4721
4722Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
4723  value = +value
4724  offset = offset >>> 0
4725  if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
4726  this[offset] = (value >>> 8)
4727  this[offset + 1] = (value & 0xff)
4728  return offset + 2
4729}
4730
4731Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
4732  value = +value
4733  offset = offset >>> 0
4734  if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
4735  this[offset + 3] = (value >>> 24)
4736  this[offset + 2] = (value >>> 16)
4737  this[offset + 1] = (value >>> 8)
4738  this[offset] = (value & 0xff)
4739  return offset + 4
4740}
4741
4742Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
4743  value = +value
4744  offset = offset >>> 0
4745  if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
4746  this[offset] = (value >>> 24)
4747  this[offset + 1] = (value >>> 16)
4748  this[offset + 2] = (value >>> 8)
4749  this[offset + 3] = (value & 0xff)
4750  return offset + 4
4751}
4752
4753Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
4754  value = +value
4755  offset = offset >>> 0
4756  if (!noAssert) {
4757    var limit = Math.pow(2, (8 * byteLength) - 1)
4758
4759    checkInt(this, value, offset, byteLength, limit - 1, -limit)
4760  }
4761
4762  var i = 0
4763  var mul = 1
4764  var sub = 0
4765  this[offset] = value & 0xFF
4766  while (++i < byteLength && (mul *= 0x100)) {
4767    if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
4768      sub = 1
4769    }
4770    this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
4771  }
4772
4773  return offset + byteLength
4774}
4775
4776Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
4777  value = +value
4778  offset = offset >>> 0
4779  if (!noAssert) {
4780    var limit = Math.pow(2, (8 * byteLength) - 1)
4781
4782    checkInt(this, value, offset, byteLength, limit - 1, -limit)
4783  }
4784
4785  var i = byteLength - 1
4786  var mul = 1
4787  var sub = 0
4788  this[offset + i] = value & 0xFF
4789  while (--i >= 0 && (mul *= 0x100)) {
4790    if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
4791      sub = 1
4792    }
4793    this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
4794  }
4795
4796  return offset + byteLength
4797}
4798
4799Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
4800  value = +value
4801  offset = offset >>> 0
4802  if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
4803  if (value < 0) value = 0xff + value + 1
4804  this[offset] = (value & 0xff)
4805  return offset + 1
4806}
4807
4808Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
4809  value = +value
4810  offset = offset >>> 0
4811  if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
4812  this[offset] = (value & 0xff)
4813  this[offset + 1] = (value >>> 8)
4814  return offset + 2
4815}
4816
4817Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
4818  value = +value
4819  offset = offset >>> 0
4820  if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
4821  this[offset] = (value >>> 8)
4822  this[offset + 1] = (value & 0xff)
4823  return offset + 2
4824}
4825
4826Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
4827  value = +value
4828  offset = offset >>> 0
4829  if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
4830  this[offset] = (value & 0xff)
4831  this[offset + 1] = (value >>> 8)
4832  this[offset + 2] = (value >>> 16)
4833  this[offset + 3] = (value >>> 24)
4834  return offset + 4
4835}
4836
4837Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
4838  value = +value
4839  offset = offset >>> 0
4840  if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
4841  if (value < 0) value = 0xffffffff + value + 1
4842  this[offset] = (value >>> 24)
4843  this[offset + 1] = (value >>> 16)
4844  this[offset + 2] = (value >>> 8)
4845  this[offset + 3] = (value & 0xff)
4846  return offset + 4
4847}
4848
4849function checkIEEE754 (buf, value, offset, ext, max, min) {
4850  if (offset + ext > buf.length) throw new RangeError('Index out of range')
4851  if (offset < 0) throw new RangeError('Index out of range')
4852}
4853
4854function writeFloat (buf, value, offset, littleEndian, noAssert) {
4855  value = +value
4856  offset = offset >>> 0
4857  if (!noAssert) {
4858    checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
4859  }
4860  ieee754.write(buf, value, offset, littleEndian, 23, 4)
4861  return offset + 4
4862}
4863
4864Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
4865  return writeFloat(this, value, offset, true, noAssert)
4866}
4867
4868Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
4869  return writeFloat(this, value, offset, false, noAssert)
4870}
4871
4872function writeDouble (buf, value, offset, littleEndian, noAssert) {
4873  value = +value
4874  offset = offset >>> 0
4875  if (!noAssert) {
4876    checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
4877  }
4878  ieee754.write(buf, value, offset, littleEndian, 52, 8)
4879  return offset + 8
4880}
4881
4882Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
4883  return writeDouble(this, value, offset, true, noAssert)
4884}
4885
4886Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
4887  return writeDouble(this, value, offset, false, noAssert)
4888}
4889
4890// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
4891Buffer.prototype.copy = function copy (target, targetStart, start, end) {
4892  if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')
4893  if (!start) start = 0
4894  if (!end && end !== 0) end = this.length
4895  if (targetStart >= target.length) targetStart = target.length
4896  if (!targetStart) targetStart = 0
4897  if (end > 0 && end < start) end = start
4898
4899  // Copy 0 bytes; we're done
4900  if (end === start) return 0
4901  if (target.length === 0 || this.length === 0) return 0
4902
4903  // Fatal error conditions
4904  if (targetStart < 0) {
4905    throw new RangeError('targetStart out of bounds')
4906  }
4907  if (start < 0 || start >= this.length) throw new RangeError('Index out of range')
4908  if (end < 0) throw new RangeError('sourceEnd out of bounds')
4909
4910  // Are we oob?
4911  if (end > this.length) end = this.length
4912  if (target.length - targetStart < end - start) {
4913    end = target.length - targetStart + start
4914  }
4915
4916  var len = end - start
4917
4918  if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {
4919    // Use built-in when available, missing from IE11
4920    this.copyWithin(targetStart, start, end)
4921  } else if (this === target && start < targetStart && targetStart < end) {
4922    // descending copy from end
4923    for (var i = len - 1; i >= 0; --i) {
4924      target[i + targetStart] = this[i + start]
4925    }
4926  } else {
4927    Uint8Array.prototype.set.call(
4928      target,
4929      this.subarray(start, end),
4930      targetStart
4931    )
4932  }
4933
4934  return len
4935}
4936
4937// Usage:
4938//    buffer.fill(number[, offset[, end]])
4939//    buffer.fill(buffer[, offset[, end]])
4940//    buffer.fill(string[, offset[, end]][, encoding])
4941Buffer.prototype.fill = function fill (val, start, end, encoding) {
4942  // Handle string cases:
4943  if (typeof val === 'string') {
4944    if (typeof start === 'string') {
4945      encoding = start
4946      start = 0
4947      end = this.length
4948    } else if (typeof end === 'string') {
4949      encoding = end
4950      end = this.length
4951    }
4952    if (encoding !== undefined && typeof encoding !== 'string') {
4953      throw new TypeError('encoding must be a string')
4954    }
4955    if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
4956      throw new TypeError('Unknown encoding: ' + encoding)
4957    }
4958    if (val.length === 1) {
4959      var code = val.charCodeAt(0)
4960      if ((encoding === 'utf8' && code < 128) ||
4961          encoding === 'latin1') {
4962        // Fast path: If `val` fits into a single byte, use that numeric value.
4963        val = code
4964      }
4965    }
4966  } else if (typeof val === 'number') {
4967    val = val & 255
4968  }
4969
4970  // Invalid ranges are not set to a default, so can range check early.
4971  if (start < 0 || this.length < start || this.length < end) {
4972    throw new RangeError('Out of range index')
4973  }
4974
4975  if (end <= start) {
4976    return this
4977  }
4978
4979  start = start >>> 0
4980  end = end === undefined ? this.length : end >>> 0
4981
4982  if (!val) val = 0
4983
4984  var i
4985  if (typeof val === 'number') {
4986    for (i = start; i < end; ++i) {
4987      this[i] = val
4988    }
4989  } else {
4990    var bytes = Buffer.isBuffer(val)
4991      ? val
4992      : Buffer.from(val, encoding)
4993    var len = bytes.length
4994    if (len === 0) {
4995      throw new TypeError('The value "' + val +
4996        '" is invalid for argument "value"')
4997    }
4998    for (i = 0; i < end - start; ++i) {
4999      this[i + start] = bytes[i % len]
5000    }
5001  }
5002
5003  return this
5004}
5005
5006// HELPER FUNCTIONS
5007// ================
5008
5009var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g
5010
5011function base64clean (str) {
5012  // Node takes equal signs as end of the Base64 encoding
5013  str = str.split('=')[0]
5014  // Node strips out invalid characters like \n and \t from the string, base64-js does not
5015  str = str.trim().replace(INVALID_BASE64_RE, '')
5016  // Node converts strings with length < 2 to ''
5017  if (str.length < 2) return ''
5018  // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
5019  while (str.length % 4 !== 0) {
5020    str = str + '='
5021  }
5022  return str
5023}
5024
5025function toHex (n) {
5026  if (n < 16) return '0' + n.toString(16)
5027  return n.toString(16)
5028}
5029
5030function utf8ToBytes (string, units) {
5031  units = units || Infinity
5032  var codePoint
5033  var length = string.length
5034  var leadSurrogate = null
5035  var bytes = []
5036
5037  for (var i = 0; i < length; ++i) {
5038    codePoint = string.charCodeAt(i)
5039
5040    // is surrogate component
5041    if (codePoint > 0xD7FF && codePoint < 0xE000) {
5042      // last char was a lead
5043      if (!leadSurrogate) {
5044        // no lead yet
5045        if (codePoint > 0xDBFF) {
5046          // unexpected trail
5047          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
5048          continue
5049        } else if (i + 1 === length) {
5050          // unpaired lead
5051          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
5052          continue
5053        }
5054
5055        // valid lead
5056        leadSurrogate = codePoint
5057
5058        continue
5059      }
5060
5061      // 2 leads in a row
5062      if (codePoint < 0xDC00) {
5063        if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
5064        leadSurrogate = codePoint
5065        continue
5066      }
5067
5068      // valid surrogate pair
5069      codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
5070    } else if (leadSurrogate) {
5071      // valid bmp char, but last char was a lead
5072      if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
5073    }
5074
5075    leadSurrogate = null
5076
5077    // encode utf8
5078    if (codePoint < 0x80) {
5079      if ((units -= 1) < 0) break
5080      bytes.push(codePoint)
5081    } else if (codePoint < 0x800) {
5082      if ((units -= 2) < 0) break
5083      bytes.push(
5084        codePoint >> 0x6 | 0xC0,
5085        codePoint & 0x3F | 0x80
5086      )
5087    } else if (codePoint < 0x10000) {
5088      if ((units -= 3) < 0) break
5089      bytes.push(
5090        codePoint >> 0xC | 0xE0,
5091        codePoint >> 0x6 & 0x3F | 0x80,
5092        codePoint & 0x3F | 0x80
5093      )
5094    } else if (codePoint < 0x110000) {
5095      if ((units -= 4) < 0) break
5096      bytes.push(
5097        codePoint >> 0x12 | 0xF0,
5098        codePoint >> 0xC & 0x3F | 0x80,
5099        codePoint >> 0x6 & 0x3F | 0x80,
5100        codePoint & 0x3F | 0x80
5101      )
5102    } else {
5103      throw new Error('Invalid code point')
5104    }
5105  }
5106
5107  return bytes
5108}
5109
5110function asciiToBytes (str) {
5111  var byteArray = []
5112  for (var i = 0; i < str.length; ++i) {
5113    // Node's code seems to be doing this and not & 0x7F..
5114    byteArray.push(str.charCodeAt(i) & 0xFF)
5115  }
5116  return byteArray
5117}
5118
5119function utf16leToBytes (str, units) {
5120  var c, hi, lo
5121  var byteArray = []
5122  for (var i = 0; i < str.length; ++i) {
5123    if ((units -= 2) < 0) break
5124
5125    c = str.charCodeAt(i)
5126    hi = c >> 8
5127    lo = c % 256
5128    byteArray.push(lo)
5129    byteArray.push(hi)
5130  }
5131
5132  return byteArray
5133}
5134
5135function base64ToBytes (str) {
5136  return base64.toByteArray(base64clean(str))
5137}
5138
5139function blitBuffer (src, dst, offset, length) {
5140  for (var i = 0; i < length; ++i) {
5141    if ((i + offset >= dst.length) || (i >= src.length)) break
5142    dst[i + offset] = src[i]
5143  }
5144  return i
5145}
5146
5147// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass
5148// the `instanceof` check but they should be treated as of that type.
5149// See: https://github.com/feross/buffer/issues/166
5150function isInstance (obj, type) {
5151  return obj instanceof type ||
5152    (obj != null && obj.constructor != null && obj.constructor.name != null &&
5153      obj.constructor.name === type.name)
5154}
5155function numberIsNaN (obj) {
5156  // For IE11 support
5157  return obj !== obj // eslint-disable-line no-self-compare
5158}
5159
5160}).call(this,require("buffer").Buffer)
5161},{"base64-js":9,"buffer":10,"ieee754":11}],11:[function(require,module,exports){
5162exports.read = function (buffer, offset, isLE, mLen, nBytes) {
5163  var e, m
5164  var eLen = (nBytes * 8) - mLen - 1
5165  var eMax = (1 << eLen) - 1
5166  var eBias = eMax >> 1
5167  var nBits = -7
5168  var i = isLE ? (nBytes - 1) : 0
5169  var d = isLE ? -1 : 1
5170  var s = buffer[offset + i]
5171
5172  i += d
5173
5174  e = s & ((1 << (-nBits)) - 1)
5175  s >>= (-nBits)
5176  nBits += eLen
5177  for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
5178
5179  m = e & ((1 << (-nBits)) - 1)
5180  e >>= (-nBits)
5181  nBits += mLen
5182  for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
5183
5184  if (e === 0) {
5185    e = 1 - eBias
5186  } else if (e === eMax) {
5187    return m ? NaN : ((s ? -1 : 1) * Infinity)
5188  } else {
5189    m = m + Math.pow(2, mLen)
5190    e = e - eBias
5191  }
5192  return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
5193}
5194
5195exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
5196  var e, m, c
5197  var eLen = (nBytes * 8) - mLen - 1
5198  var eMax = (1 << eLen) - 1
5199  var eBias = eMax >> 1
5200  var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
5201  var i = isLE ? 0 : (nBytes - 1)
5202  var d = isLE ? 1 : -1
5203  var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
5204
5205  value = Math.abs(value)
5206
5207  if (isNaN(value) || value === Infinity) {
5208    m = isNaN(value) ? 1 : 0
5209    e = eMax
5210  } else {
5211    e = Math.floor(Math.log(value) / Math.LN2)
5212    if (value * (c = Math.pow(2, -e)) < 1) {
5213      e--
5214      c *= 2
5215    }
5216    if (e + eBias >= 1) {
5217      value += rt / c
5218    } else {
5219      value += rt * Math.pow(2, 1 - eBias)
5220    }
5221    if (value * c >= 2) {
5222      e++
5223      c /= 2
5224    }
5225
5226    if (e + eBias >= eMax) {
5227      m = 0
5228      e = eMax
5229    } else if (e + eBias >= 1) {
5230      m = ((value * c) - 1) * Math.pow(2, mLen)
5231      e = e + eBias
5232    } else {
5233      m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
5234      e = 0
5235    }
5236  }
5237
5238  for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
5239
5240  e = (e << mLen) | m
5241  eLen += mLen
5242  for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
5243
5244  buffer[offset + i - d] |= s * 128
5245}
5246
5247},{}],12:[function(require,module,exports){
5248// shim for using process in browser
5249var process = module.exports = {};
5250
5251// cached from whatever global is present so that test runners that stub it
5252// don't break things.  But we need to wrap it in a try catch in case it is
5253// wrapped in strict mode code which doesn't define any globals.  It's inside a
5254// function because try/catches deoptimize in certain engines.
5255
5256var cachedSetTimeout;
5257var cachedClearTimeout;
5258
5259function defaultSetTimout() {
5260    throw new Error('setTimeout has not been defined');
5261}
5262function defaultClearTimeout () {
5263    throw new Error('clearTimeout has not been defined');
5264}
5265(function () {
5266    try {
5267        if (typeof setTimeout === 'function') {
5268            cachedSetTimeout = setTimeout;
5269        } else {
5270            cachedSetTimeout = defaultSetTimout;
5271        }
5272    } catch (e) {
5273        cachedSetTimeout = defaultSetTimout;
5274    }
5275    try {
5276        if (typeof clearTimeout === 'function') {
5277            cachedClearTimeout = clearTimeout;
5278        } else {
5279            cachedClearTimeout = defaultClearTimeout;
5280        }
5281    } catch (e) {
5282        cachedClearTimeout = defaultClearTimeout;
5283    }
5284} ())
5285function runTimeout(fun) {
5286    if (cachedSetTimeout === setTimeout) {
5287        //normal enviroments in sane situations
5288        return setTimeout(fun, 0);
5289    }
5290    // if setTimeout wasn't available but was latter defined
5291    if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
5292        cachedSetTimeout = setTimeout;
5293        return setTimeout(fun, 0);
5294    }
5295    try {
5296        // when when somebody has screwed with setTimeout but no I.E. maddness
5297        return cachedSetTimeout(fun, 0);
5298    } catch(e){
5299        try {
5300            // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
5301            return cachedSetTimeout.call(null, fun, 0);
5302        } catch(e){
5303            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
5304            return cachedSetTimeout.call(this, fun, 0);
5305        }
5306    }
5307
5308
5309}
5310function runClearTimeout(marker) {
5311    if (cachedClearTimeout === clearTimeout) {
5312        //normal enviroments in sane situations
5313        return clearTimeout(marker);
5314    }
5315    // if clearTimeout wasn't available but was latter defined
5316    if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
5317        cachedClearTimeout = clearTimeout;
5318        return clearTimeout(marker);
5319    }
5320    try {
5321        // when when somebody has screwed with setTimeout but no I.E. maddness
5322        return cachedClearTimeout(marker);
5323    } catch (e){
5324        try {
5325            // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally
5326            return cachedClearTimeout.call(null, marker);
5327        } catch (e){
5328            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
5329            // Some versions of I.E. have different rules for clearTimeout vs setTimeout
5330            return cachedClearTimeout.call(this, marker);
5331        }
5332    }
5333
5334
5335
5336}
5337var queue = [];
5338var draining = false;
5339var currentQueue;
5340var queueIndex = -1;
5341
5342function cleanUpNextTick() {
5343    if (!draining || !currentQueue) {
5344        return;
5345    }
5346    draining = false;
5347    if (currentQueue.length) {
5348        queue = currentQueue.concat(queue);
5349    } else {
5350        queueIndex = -1;
5351    }
5352    if (queue.length) {
5353        drainQueue();
5354    }
5355}
5356
5357function drainQueue() {
5358    if (draining) {
5359        return;
5360    }
5361    var timeout = runTimeout(cleanUpNextTick);
5362    draining = true;
5363
5364    var len = queue.length;
5365    while(len) {
5366        currentQueue = queue;
5367        queue = [];
5368        while (++queueIndex < len) {
5369            if (currentQueue) {
5370                currentQueue[queueIndex].run();
5371            }
5372        }
5373        queueIndex = -1;
5374        len = queue.length;
5375    }
5376    currentQueue = null;
5377    draining = false;
5378    runClearTimeout(timeout);
5379}
5380
5381process.nextTick = function (fun) {
5382    var args = new Array(arguments.length - 1);
5383    if (arguments.length > 1) {
5384        for (var i = 1; i < arguments.length; i++) {
5385            args[i - 1] = arguments[i];
5386        }
5387    }
5388    queue.push(new Item(fun, args));
5389    if (queue.length === 1 && !draining) {
5390        runTimeout(drainQueue);
5391    }
5392};
5393
5394// v8 likes predictible objects
5395function Item(fun, array) {
5396    this.fun = fun;
5397    this.array = array;
5398}
5399Item.prototype.run = function () {
5400    this.fun.apply(null, this.array);
5401};
5402process.title = 'browser';
5403process.browser = true;
5404process.env = {};
5405process.argv = [];
5406process.version = ''; // empty string to avoid regexp issues
5407process.versions = {};
5408
5409function noop() {}
5410
5411process.on = noop;
5412process.addListener = noop;
5413process.once = noop;
5414process.off = noop;
5415process.removeListener = noop;
5416process.removeAllListeners = noop;
5417process.emit = noop;
5418process.prependListener = noop;
5419process.prependOnceListener = noop;
5420
5421process.listeners = function (name) { return [] }
5422
5423process.binding = function (name) {
5424    throw new Error('process.binding is not supported');
5425};
5426
5427process.cwd = function () { return '/' };
5428process.chdir = function (dir) {
5429    throw new Error('process.chdir is not supported');
5430};
5431process.umask = function() { return 0; };
5432
5433},{}]},{},[2]);