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

Function: decodeNonNegativeInt()

function decodeNonNegativeInt(
  buffer,
): number & Brand<"Int"> & Brand<"NonNegative">;

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

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?