17 stable releases
|new 2.1.0||Oct 16, 2020|
|1.1.5||Mar 17, 2020|
|1.0.7||Jun 15, 2019|
|0.12.0||Jun 19, 2016|
#37 in Encoding
33,836 downloads per month
Used in 84 crates (22 directly)
This crate provides encoding and decoding of integers to and from bytestring representations.
The format is described here: Google's protobuf integer encoding technique.
FixedInt casts integers to bytes by either copying the underlying memory or
performing a transmutation. The encoded values use machine endianness
(little-endian on x86).
VarInt encodes integers in blocks of 7 bits; the MSB is set for every byte but
the last, in which it is cleared.
Signed values are first converted to an unsigned representation using zigzag encoding (also described on the page linked above), and then encoded as every other unsigned number.