Expand description
Unsigned LEB128 varint encoding.
A varint encodes an unsigned integer in one to ten bytes. The low seven
bits of each byte carry payload, and the top bit signals continuation:
1 means more bytes follow, 0 means the value is complete.
The encoding is identical to the format used by Protocol Buffers, WebAssembly, and DWARF.
Constants§
- MAX_
LEN_ U16 - Maximum encoded length of a
u16varint. - MAX_
LEN_ U32 - Maximum encoded length of a
u32varint. - MAX_
LEN_ U64 - Maximum encoded length of a
u64varint.
Functions§
- decode_
u32 - Decode a
u32varint frombuf. - decode_
u64 - Decode a
u64varint frombuf. - encode_
u32 - Encode
valueas au32varint intobuf. - encode_
u64 - Encode
valueas au64varint intobuf. - encoded_
len_ u32 - Encoded length of
valueas au32varint, in bytes (1 to 5). - encoded_
len_ u64 - Encoded length of
valueas au64varint, in bytes (1 to 10).