4 stable releases (3 major)
4.0.0 | Sep 7, 2020 |
---|---|
3.0.0 | Feb 28, 2019 |
2.0.0 | Oct 11, 2018 |
1.0.0 | Oct 10, 2018 |
#1251 in Encoding
9KB
94 lines
lebicon
Lebicon implements the codicon
traits for LEB128 encoding / decoding.
Examples
use codicon::*;
use lebicon::Leb128;
let encoded = [198, 253, 255, 127];
let decoded = 268435142u64;
let value = u64::decode(&mut &encoded[..], Leb128).unwrap();
assert_eq!(value, decoded);
let mut value: Vec<u8> = Vec::new();
decoded.encode(&mut value, Leb128).unwrap();
assert_eq!(&value[..], &encoded[..]);
License: Apache-2.0
Dependencies
~20KB