#binary-encoding #binary #leb128 #data-encoding #integer #binary-format #vbyte

binout

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

5 unstable releases

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

#1800 in Encoding

Download history 7729/week @ 2024-08-26 6033/week @ 2024-09-02 5662/week @ 2024-09-09 4601/week @ 2024-09-16 4592/week @ 2024-09-23 4678/week @ 2024-09-30 4346/week @ 2024-10-07 4384/week @ 2024-10-14 5100/week @ 2024-10-21 4130/week @ 2024-10-28 5972/week @ 2024-11-04 4791/week @ 2024-11-11 4993/week @ 2024-11-18 3321/week @ 2024-11-25 4378/week @ 2024-12-02 3794/week @ 2024-12-09

16,647 downloads per month
Used in 13 crates (5 directly)

MIT/Apache

16KB
267 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