6 stable releases
Uses old Rust 2015
1.0.6 | Jul 10, 2018 |
---|---|
1.0.4 | May 29, 2018 |
1.0.3 | May 24, 2018 |
1.0.2 | Jan 17, 2016 |
#1167 in Encoding
1,020 downloads per month
Used in 13 crates
(3 directly)
6KB
94 lines
varinteger
Rust module for encoding/decoding varints that doesn't do any IO. Inspired by the Node.js varint module.
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