API reference / @evolu/common / local-first/Protocol / encodeNonNegativeInt
Function: encodeNonNegativeInt()
function encodeNonNegativeInt(buffer, int): void;
Defined in: packages/common/src/local-first/Protocol.ts:1851
Encodes a non-negative integer into a variable-length integer format. It's more efficient than encoding via encodeNumber.
https://en.wikipedia.org/wiki/Variable-length_quantity
Parameters
| Parameter | Type |
|---|---|
buffer | Buffer |
int | number & Brand<"Int"> & Brand<"NonNegative"> |
Returns
void