API reference / @evolu/common / local-first/Protocol / decodeLength

Variable: decodeLength()

const decodeLength: (buffer) => number & Brand<"Int"> & Brand<"NonNegative"> =
  decodeNonNegativeInt;

Defined in: packages/common/src/local-first/Protocol.ts:1904

Decodes a non-negative integer from a variable-length integer format.

https://en.wikipedia.org/wiki/Variable-length_quantity

Parameters

ParameterType
bufferBuffer

Returns

number & Brand<"Int"> & Brand<"NonNegative">

Was this page helpful?