Crate fastvlq[][src]

Expand description

Algorithm

Fast VLQ is a variant of value-length quantity encoding, with a focus on encoding and decoding speed. The total number of bytes can always be derived from the very first byte, and unlike VLQ, the integer type supported is u64 exclusively, and will take up a maximum of 9 bytes (for values greater than 56-bit).

This crate does not enforce an invariant that a number may only have one representation, which means that it is possible to encode 1 as, for example, both 0b1000_0001 and 0b0100_0000_0000_0001.

Usage

Add this to your Cargo.toml:

[dependencies]
fastvlq = "1"

Structs

An unsigned 64-bit integer in value-length quantity encoding.

Traits

Extension trait to support reading bytes from standard reader interface as VLQ.

Extension trait to support writing VLQ to standard writer interface.

Functions

Decode a given VLQ instance back into a native u64.

Encode a u64 in value-length quantity encoding.