wasabi_leb128

Crates.iowasabi_leb128
lib.rswasabi_leb128
version0.4.0
sourcesrc
created_at2019-10-02 14:20:08.973378
updated_at2020-03-06 17:29:08.089561
descriptionRead and write the variable length LEB128 number format.
homepage
repositoryhttps://github.com/danleh/wasabi_leb128
max_upload_size
id169377
size25,881
Daniel Lehmann (danleh)

documentation

https://docs.rs/wasabi_leb128/

README

wasabi_leb128 build status

Read and write the variable length LEB128 number format. For example:

use wasabi_leb128::{ReadLeb128, WriteLeb128};

// Vec<u8> as byte-oriented reader/writer.
let mut buf = Vec::new();

// Encoding/writing a u16 as an LEB128 byte sequence.
let original_value: u16 = 128;
buf.write_leb128(original_value).unwrap();
assert_eq!(buf, [0x80, 0x01]);

// Decoding/reading an LEB128 number back to a u16.
let value: u16 = buf.as_slice().read_leb128().unwrap();
assert_eq!(value, original_value);

For more info, see:

Commit count: 48

cargo fmt