• uvar stands for unsigned variable-sized integer
    this number occupies a variable number of bytes to accommodate the integer that it's holding
    it uses the first bit of the octet (0bXYYYYYYY) to signal whether the integer carries on to the next byte (X == 1) or not (X == 0),
    and uses base 7 big endian encoding to read the data bytes (YYYYYYY)
    you can read more about it on wikipedia.
    the following table lists the first few bounds of this encoding:

    decimal unsigned big endian binary unsigned variable binary
    0 0b00000000 0b00000000 0b00000000 0b00000000 0b00000000
    127 = 2^7 - 1 0b00000000 0b00000000 0b00000000 0b01111111 0b01111111
    128 = 2^7 0b00000000 0b00000000 0b00000000 0b10000000 0b10000001 0b00000000
    16383 = 2^14 - 1 0b00000000 0b00000000 0b00111111 0b11111111 0b11111111 0b01111111
    16384 = 2^14 0b00000000 0b00000000 0b01000000 0b00000000 0b10000001 0b10000000 0b00000000

    this encoding is especially useful for encoding the length of other variables as in their header (beginning of their sequence)

    Parameters

    • value: number
    • Rest ...args: []

    Returns Uint8Array

Generated using TypeDoc