#binary-encoding #binary #leb128 #integer #codec #vbyte

binout

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

4 releases

0.2.1 Feb 24, 2024
0.2.0 May 19, 2023
0.1.1 Jul 13, 2022
0.1.0 Jul 11, 2022

#716 in Encoding

Download history 3085/week @ 2024-01-25 2848/week @ 2024-02-01 2849/week @ 2024-02-08 3394/week @ 2024-02-15 5510/week @ 2024-02-22 6251/week @ 2024-02-29 5270/week @ 2024-03-07 5103/week @ 2024-03-14 4257/week @ 2024-03-21 3657/week @ 2024-03-28 3751/week @ 2024-04-04 4130/week @ 2024-04-11 5199/week @ 2024-04-18 4499/week @ 2024-04-25 4017/week @ 2024-05-02 3531/week @ 2024-05-09

17,911 downloads per month
Used in 13 crates (5 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