Crate cobs_rs[][src]

A very minimal no_std Consistent Overhead Byte Stuffing library

Usage

This library provides 2 functions.

stuff and unstuff which encode and decode according to the COBS standard, respectively.

Example

let data: [u8; 254] = [
    // ...snip
];

// Encode the data
let encoded: [u8; 256] = cobs_rs::stuff(data, 0x00);

// ... snip

// Decode the data
let decoded: [u8; 254] = cobs_rs::unstuff(encoded, 0x00);

assert_eq!(data, decoded);

License

Licensed under a MIT license.

Functions

stuff

Takes an input buffer and a marker value and COBS-encodes it to an output buffer.

unstuff

Takes an input buffer and a marker value and COBS-decodes it to an output buffer.