leb128
Read and write DWARF's "Little Endian Base 128" (LEB128) variable length integer encoding.
The implementation is a direct translation of the psuedocode in the DWARF 4 standard's appendix C.
Install
Either
$ cargo add leb128
or add this to your Cargo.toml
:
[dependencies]
leb128 = "0.1.0"
Example
use leb128;
let mut buf = ;
// Write to anything that implements `std::io::Write`.
// Read from anything that implements `std::io::Read`.
let mut readable = &buf;
let val = signed.expect;
assert_eq!;
Documentation
License
Licensed under either of
- Apache License, Version 2.0 (
LICENSE-APACHE
or http://www.apache.org/licenses/LICENSE-2.0) - MIT license (
LICENSE-MIT
or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.