7 releases (breaking)
0.7.0 | Nov 13, 2023 |
---|---|
0.6.1 | Sep 2, 2023 |
0.6.0 | Aug 14, 2023 |
0.5.0 | Aug 12, 2023 |
0.1.1 | Nov 11, 2022 |
#1131 in Data structures
48KB
1K
SLoC
Algebraic Tag Length Value encoding for Rust
atlv
is a generic binary data encoding
that preserves the data's leaf-spine structure
while providing customizable tags and dictating minimal semantics.
value: quant | binary | union | array
quant: tag…00(vlq) (vlq)
binary: tag…01(vlq) len(vlq) byte[len]
union: tag…10(vlq) value
array: tag…11(vlq) len(vlq) value[len]
vlq: 0xxxxxxx | 1xxxxxxx vlq
byte: xxxxxxxx
tag: xxxxx | xxxxxxx tag
This repository contains a Rust crate for encoding, decoding, and generally manipulating atlv
data.
lib.rs
:
Encode and decode atlv values.
Algebraic Tag Length Value (atlv) is a binary data encoding designed for extensibility, generality, and compactness. Each value has a flexible-length tag, and may be one of four [Kind]s, two simple and two recursive:
- Quantities encode enumerable values, using Variable Length Quantities.
- Binaries encode sequences of bytes.
- Unions encapsulate a single value.
- Arrays encapsulate a sequence of values.
This crate provides a trait to encode and decode rust values directly into atlv streams, and a type to model and genericly encode and decode arbitrary atlv values. Use the trait unless you need to manipulate or examine unstructured atlv values.
Dependencies
~200KB