Skip to content

darkcodi/cobsin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📦 cobsin

crates.io docs.rs MIT License

COBS encoding/decoding, in-place. no_std, zero allocations.

COBS (Consistent Overhead Byte Stuffing) eliminates zero bytes from data — perfect for packet protocols where 0x00 marks boundaries.

✨ Why?

  • 🔧 In-place — encode/decode without extra buffers
  • 📦 no_std — works on bare-metal & embedded
  • 🚀 Zero alloc — no heap, ever
  • 📭 Zero deps — no external dependencies

🚀 Quick look

let mut buf = [0u8; 32];
buf[..11].copy_from_slice(b"Hello\x00World");

// Encode
let enc_len = cobsin::cobs_encode_in_place(&mut buf, 11)?;

// Decode
let dec_len = cobsin::cobs_decode_in_place(&mut buf, enc_len)?;

assert_eq!(&buf[..dec_len], b"Hello\x00World");

📦 Install

[dependencies]
cobsin = "0.1"

MIT — do whatever.

About

COBS encoding/decoding, in-place.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages