Skip to content

Releases: firechip/cobs_codec_rs

cobs_codec_rs 1.3.0

Choose a tag to compare

@ajsb85 ajsb85 released this 05 Jul 06:01
v1.3.0
49ec3d2

cobs_codec_rs 1.3.0

Feature + tooling release, fully backward compatible — 1.2.x code compiles unchanged. Byte-identical to the Dart, Kotlin, and Swift members of the Firechip COBS family.

✨ New features

  • COBS/R in-place decodecobsr::decode_in_place / decode_in_place_with_sentinel decode the reduced codec within the caller's buffer and return the decoded length (COBS/R never expands the data).
  • Optional serde and defmt derives on DecodeError, behind the new serde / defmt features. Both stay off by default, so the default build remains no_std and dependency-free.

🔧 Tooling & tests

  • A criterion throughput benchmark (benches/throughput.rs).
  • Fuzzing — cargo-fuzz targets plus a stable, dependency-free robustness test in ordinary CI.
  • A Protobuf + COBS framing example (examples/protobuf_cobs.rs).
  • Conformance now also checks the configurable-sentinel and decode-error vectors.

📦 Install

cobs_codec_rs = "1.3"

crates.io: https://crates.io/crates/cobs_codec_rs/1.3.0 · docs.rs: https://docs.rs/cobs_codec_rs/1.3.0

The attached cobs_codec_rs-1.3.0.crate is the exact published source distribution (from crates.io).

cobs_codec_rs 1.2.0

Choose a tag to compare

@ajsb85 ajsb85 released this 04 Jul 16:55
v1.2.0
d555943

cobs_codec_rs 1.2.0

A maintenance + documentation release. No API changes — 1.1.0 code compiles unchanged.

🔧 Changed

  • Rust edition 2024 — the MSRV is raised to 1.85 (required by the edition). No source changes were needed; only import ordering was updated to the 2024 style.
  • CI: actions/checkout bumped to v7, and the MSRV job now pins Rust 1.85.

📚 Documentation

  • The Cheshire & Baker (1999) overhead bounds now render as math on docs.rs (via KaTeX): the encoded length is at most n + ⌈n/254⌉ bytes, and max_encoded_len / encoding_overhead document their closed forms.

Recap — the 1.1.x feature line

Configurable sentinel, in-place decode, and an allocation-free StreamDecoder — see the v1.1.0 release.

📦 Install

cobs_codec_rs = "1.2"

crates.io: https://crates.io/crates/cobs_codec_rs/1.2.0 · docs.rs: https://docs.rs/cobs_codec_rs/1.2.0

The attached cobs_codec_rs-1.2.0.crate is the exact published source distribution.

cobs_codec_rs 1.1.0

Choose a tag to compare

@ajsb85 ajsb85 released this 04 Jul 16:55
v1.1.0
49b1beb

cobs_codec_rs 1.1.0

Three new capabilities for the #![no_std], zero-dependency COBS / COBS-R codec — all additive and backward compatible, and byte-identical to the Dart and Kotlin members of the Firechip COBS family.

✨ New features

Configurable sentinel — frame on any delimiter byte, not just 0x00. New *_with_sentinel variants on both cobs and cobsr (slice and *_to_vec) make the encoded output avoid your chosen byte. It works by XOR-ing the finished encoding with the sentinel, so sentinel == 0 is byte-for-byte identical to the plain codec.

let enc = cobs::encode_to_vec_with_sentinel(&[0x11, 0xAA, 0x22], 0xAA); // [0xAE, 0xBB, 0x00, 0x88] — no 0xAA
cobs::decode_to_vec_with_sentinel(&enc, 0xAA).unwrap();                 // [0x11, 0xAA, 0x22]

In-place decode (basic COBS) — cobs::decode_in_place(&mut buf) decodes within the same buffer and returns the length; COBS never expands on decode, so no second allocation is needed.

Allocation-free streamingframing::StreamDecoder reassembles delimiter-framed packets into a caller-provided fixed buffer: the pure-no_std counterpart of FrameDecoder, with .reduced() (COBS/R) and .sentinel() options.

✅ Verified

  • clippy pedantic clean (all-features and no_std), bare-metal thumbv7em-none-eabihf build, MSRV 1.81.
  • 2261 shared conformance vectors + a 19,644-vector differential against the Python reference — byte-identical.

📦 Install

cobs_codec_rs = "1.1"

crates.io: https://crates.io/crates/cobs_codec_rs/1.1.0 · docs: https://docs.rs/cobs_codec_rs/1.1.0

The attached cobs_codec_rs-1.1.0.crate is the exact published source distribution.

cobs_codec_rs 1.0.0

Choose a tag to compare

@ajsb85 ajsb85 released this 05 Jul 06:01
v1.0.0
0c1f783

cobs_codec_rs 1.0.0

Initial release — a #![no_std], dependency-free COBS / COBS-R codec for zero-free framing of serial and packet byte streams.

✨ Added

  • Basic COBS and COBS/R encode/decode over caller-provided slices (cobs / cobsr modules), #![no_std] and allocation-free.
  • alloc-gated *_to_vec conveniences and a streaming framing::FrameDecoder with a max_frame_len bound.
  • const fn size helpers max_encoded_len and encoding_overhead.
  • DecodeError implementing core::error::Error.
  • Golden-vector + conformance tests against firechip/cobs-conformance — 2,261 vectors, byte-identical to the reference.

📦 Install

cobs_codec_rs = "1.0"

crates.io: https://crates.io/crates/cobs_codec_rs/1.0.0 · docs.rs: https://docs.rs/cobs_codec_rs/1.0.0

The attached cobs_codec_rs-1.0.0.crate is the exact published source distribution (from crates.io).