~alva/zig-varint

varint encoding and decoding
keep up with zig
keep up with build system

refs

trunk
browse  log 

clone

read-only
https://git.sr.ht/~alva/zig-varint
read/write
git@git.sr.ht:~alva/zig-varint

You can also use your local clone with git send-email.

#zig-varint

builds.sr.ht status

Encoding and decoding of variable-length signed and unsigned integers using the Unsigned Little Endian Base 128 (ULEB128).

#usage

There's functions for encoding and decoding using writers and readers, as well as functions that work on slices.

var buf: [4]u8 = undefined;
const x: u64 = 42;
const encoded = try encodeVarUintSlice(&buf, x);
const decoded = try decodeVarUintSlice(encoded);
try testing.expectEqual(x, decoded);