 === 43) return 62;
    if (nChr === 47) return 63;
    return 0;
  }

  Base64.getDecodedBufferLength = function(input) {
    let pad = 0;
    if (input.substr(-2) === '==') {
      pad = 2;
    } else if (input.substr(-1) === '=') {
      pad = 1;
    }
    return ((input.length * 3 + 1) >> 2) - pad;
  };

  Base64.EncodeArrayBufferToString = function(input) {
    // http://stackoverflow.com/questions/9267899/
    let binary = '';
    const bytes = new Uint8Array(input);
    const len = bytes.byteLength;
