gvli 1.0.0

Generalized variable-length integers
Documentation
  • Coverage
  • 100%
    24 out of 24 items documented6 out of 13 items with examples
  • Size
  • Source code size: 50.86 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.24 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 16s Average build duration of successful builds.
  • all releases: 16s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • cigix/gvli
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • cigix

RFC 3492's Generalized Variable-Length Integers

RFC 3492, at section 3.3, gives a numbering system that allows for efficient representation of consecutive arbitrary numbers.

This crate is an implementation of this numbering system, in a generic fashion that can be used outside of just RFC 3492 implementations.

Example

let parameters = gvli::Parameters::from_parts(&gvli::BASE_OCTAL, &[2, 3, 5]).unwrap();

let encoded = gvli::encode(&[145, 62], &parameters);
assert_eq!(encoded, "734251");

let decoded = gvli::decode(&encoded, &parameters).unwrap();
assert_eq!(decoded, [145, 62]);

References