strata-rs 0.4.1

Deterministic binary data format with canonical encoding
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::encode::encode;
use crate::value::Value;

const STRATA_MAGIC: &[u8; 7] = b"STRATA1";
const STRATA_VERSION: u8 = 0x01;

pub fn encode_framed(value: &Value) -> Vec<u8> {
    let mut out = Vec::new();

    out.extend_from_slice(STRATA_MAGIC);
    out.push(STRATA_VERSION);
    out.extend_from_slice(&encode(value).unwrap());

    out
}