binout

Crates.iobinout
lib.rsbinout
version0.3.0
sourcesrc
created_at2022-07-11 20:03:20.897751
updated_at2024-10-02 08:37:14.487112
descriptionThe library for binary serialization/deserialization of integers and arrays of integers.
homepage
repositoryhttps://github.com/beling/bsuccinct-rs
max_upload_size
id623978
size15,790
Piotr Beling (beling)

documentation

https://docs.rs/binout

README

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);
Commit count: 673

cargo fmt