varinteger

Crates.iovarinteger
lib.rsvarinteger
version1.0.6
sourcesrc
created_at2016-01-17 14:55:38.026897
updated_at2018-07-10 15:22:38.616663
descriptionRust module for encoding/decoding varints that doesn't do any IO. Inspired by the Node.js varint module
homepage
repositoryhttps://github.com/mafintosh/varinteger-rs
max_upload_size
id3908
size6,722
Maintainers (github:datrs:maintainers)

documentation

README

varinteger

Rust module for encoding/decoding varints that doesn't do any IO. Inspired by the Node.js varint module.

build status

Usage

extern crate varinteger;

let mut buf = [0; 512];

// encode 1000 as a varint into buf. returns how many bytes it wrote
let bytes_encoded = varinteger::encode(1000, buf);

let mut value = 0u64;
let bytes_decoded = varinteger::decode(buf, &mut value);

println!("encoded and decoded {}", value);

License

MIT

Commit count: 23

cargo fmt