#io #binary #encoding #vbyte #leb128

binout

The library for binary serialization/deserialization of integers and arrays of integers

3 unstable releases

new 0.2.0 May 19, 2023
0.1.1 Jul 13, 2022
0.1.0 Jul 11, 2022

#545 in Encoding

Download history 21/week @ 2023-02-02 18/week @ 2023-02-09 22/week @ 2023-02-16 11/week @ 2023-02-23 10/week @ 2023-03-02 6/week @ 2023-03-09 10/week @ 2023-03-16 5/week @ 2023-03-23 10/week @ 2023-03-30 30/week @ 2023-04-06 1/week @ 2023-04-13 2/week @ 2023-04-20 9/week @ 2023-04-27 10/week @ 2023-05-04 19/week @ 2023-05-11 81/week @ 2023-05-18

121 downloads per month
Used in 3 crates (2 directly)

MIT/Apache

14KB
241 lines

binout is the Rust library by Piotr Beling for low-level, portable, bytes-oriented, binary encoding, decoding, serialization, deserialization of integers and arrays of integers.

It supports slightly improved VByte/LEB128 format (see [VByte]) as well as simple, little-endian, as-is serialization (see [AsIs]).

Example

use binout::{VByte, Serializer};

let value = 123456u64;
let mut buff = Vec::new();
assert!(VByte::write(&mut buff, value).is_ok());
assert_eq!(buff.len(), VByte::size(value));
let read: u64 = VByte::read(&mut &buff[..]).unwrap();
assert_eq!(read, value);

No runtime deps