[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [local‑first/Protocol](https://evolu.dev/docs/api-reference/common/local-first/Protocol) › decodeNonNegativeInt

```ts
function decodeNonNegativeInt(
  buffer: Buffer,
): number &
  Brand<"NonNaN"> &
  Brand<"Finite"> &
  Brand<"Int"> &
  Brand<"NonNegative">;
```

Defined in: [packages/common/src/local-first/Protocol.ts:2010](https://github.com/evoluhq/evolu/blob/037c390af081e9944d616ff298a729515c5c5ab7/packages/common/src/local-first/Protocol.ts#L2010)

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

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