dusk-varint

Crates.iodusk-varint
lib.rsdusk-varint
version0.1.0
sourcesrc
created_at2021-05-26 12:07:41.889567
updated_at2021-05-26 12:07:41.889567
descriptionvarint+zigzag integer encoding/decoding (no_std)
homepage
repositoryhttps://github.com/dusk-network/dusk-varint
max_upload_size
id402237
size17,027
kristoffer (krl)

documentation

https://docs.rs/dusk-varint/

README

dusk-varint

minimal no_std fork of integer-encoding

The format is described here: Google's protobuf integer encoding technique.

Please feel free to use cargo bench to determine the rate at which your machine can encode and decode varints and fixedints. Note that one iteration comprises each eight rounds of encoding (or decoding) a signed and an unsigned integer each -- divide the resulting benchmark time by 16 in order to have a rough estimate of time per operation. The integers are very large, so the results represent the worst case.

VarInt

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.

Commit count: 139

cargo fmt