COBS v0.1.2 Cobs View Source

Elixir implementation of Consistent Overhead Byte Stuffing

Link to this section Summary

Functions

Decode COBS encoded binary (without 0 bytes) into a binary (with 0 bytes)

Encode a binary (with 0 bytes) into a COBS encoded binary (without 0 bytes)

Link to this section Functions

Decode COBS encoded binary (without 0 bytes) into a binary (with 0 bytes).

Example

iex> Cobs.decode(<<0x03, 0x01, 0x02, 0x02, 0x03>>)
<<0x01, 0x02, 0x00, 0x03>>

Encode a binary (with 0 bytes) into a COBS encoded binary (without 0 bytes).

Example

iex> Cobs.encode(<<0x01, 0x02, 0x00, 0x03>>)
<<0x03, 0x01, 0x02, 0x02, 0x03>>