unsigned: {
    decode(
        buf: Uint8Array<ArrayBufferLike>,
        offset?: number,
    ): [bigint, number];
    encode(num: string | number | bigint): Uint8Array<ArrayBuffer>;
    encodingLength(buf: Uint8Array<ArrayBufferLike>, offset?: number): number;
} = ...

Type declaration

  • decode:function
    • Decode a Uint8Array into a number.

      Parameters

      • buf: Uint8Array<ArrayBufferLike>

        Uint8Array containing the representation in LEB128

      • offset: number = 0

        Offset to read from

      Returns [bigint, number]

      • The decoded number and the number of bytes read
  • encode:function
    • Create a LEB128 Uint8Array from a number

      Parameters

      • num: string | number | bigint

        Number to convert from

      Returns Uint8Array<ArrayBuffer>

  • encodingLength:function
    • Parameters

      • buf: Uint8Array<ArrayBufferLike>
      • offset: number = 0

      Returns number