addASN1BigInt(bytes) {
    // Zero is representated as a single zero byte, rather than no bytes.
    if (bytes.length == 0) {
      bytes = new Uint8Array(1);
    }

    // Leading zero bytes need to be removed, unless that would make the number
    // negative.
    while (bytes.length >= 2 && bytes[0] == 0 && (bytes[1] & 0x80) == 0) {
      bytes = bytes.slice(1);
    }

    // If the MSB is set, the number will be considered to be negative. Thus
    // a zero prefix is needed in that case.
    if (bytes.length > 0 && (bytes[0] & 0x80) == 0x80) {
      if (bytes.length > Number.MAX_SAFE_INTEGER - 1) {
        throw Error('bigint array too long');
      }
      var newBytes = new Uint8Array(bytes.length + 1);
      newBytes.set(bytes, 1);
      bytes = newBytes;
    }

    this.addASN1(Tag.INTEGER, (b) => b.addBytes(bytes));
  }
/**
   * Appends a non-negative ASN.1 INTEGER to the slice given its big-endian
   *     encoding. This can be useful when interacting with the WebCrypto API.
   * @param {!Uint8Array} bytes The big-endian encoding of the integer.
   * @throws {Error}
   */
Appends a non-negative ASN.1 INTEGER to the slice given its big-endian
encoding. This can be useful when interacting with the WebCrypto API.
@param {!Uint8Array} bytes The big-endian encoding of the integer.
@throws {Error}
Appends a non - negative ASN . 1 INTEGER to the slice given its big - endian encoding . This can be useful when interacting with the WebCrypto API . @param { !Uint8Array } bytes The big - endian encoding of the integer . @throws { Error }
addASN1BigInt(bytes) {
    if (bytes.length == 0) {
      bytes = new Uint8Array(1);
    }
    while (bytes.length >= 2 && bytes[0] == 0 && (bytes[1] & 0x80) == 0) {
      bytes = bytes.slice(1);
    }
    if (bytes.length > 0 && (bytes[0] & 0x80) == 0x80) {
      if (bytes.length > Number.MAX_SAFE_INTEGER - 1) {
        throw Error('bigint array too long');
      }
      var newBytes = new Uint8Array(bytes.length + 1);
      newBytes.set(bytes, 1);
      bytes = newBytes;
    }
    this.addASN1(Tag.INTEGER, (b) => b.addBytes(bytes));
  }
addASN1BigInt ( bytes ) { if ( bytes . length == 0 ) { bytes = new Uint8Array ( 1 ) ; } while ( bytes . length >= 2 && bytes [ 0 ] == 0 && ( bytes [ 1 ] & 0x80 ) == 0 ) { bytes = bytes . slice ( 1 ) ; } if ( bytes . length > 0 && ( bytes [ 0 ] & 0x80 ) == 0x80 ) { if ( bytes . length > Number . MAX_SAFE_INTEGER - 1 ) { throw Error ( 'bigint array too long' ) ; } var newBytes = new Uint8Array ( bytes . length + 1 ) ; newBytes . set ( bytes , 1 ) ; bytes = newBytes ; } this . addASN1 ( Tag . INTEGER , ( b ) => b . addBytes ( bytes ) ) ; }
Appends a non-negative ASN.1 INTEGER to the slice given its big-endian
     encoding.
Appends a non - negative ASN . 1 INTEGER to the slice given its big - endian encoding .
// Zero is representated as a single zero byte, rather than no bytes. // Leading zero bytes need to be removed, unless that would make the number // negative. // If the MSB is set, the number will be considered to be negative. Thus // a zero prefix is needed in that case.