Rust module for encoding/decoding varints that doesn't do any IO. Inspired by the Node.js varint module.
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);
MIT