This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Consistent Overhead Byte Stuffing (COBS)

Project Description

Python functions for encoding and decoding COBS.

Complete cobs documentation is at https://pythonhosted.org/cobs/

Intro

The cobs package is provided, which contains modules containing functions for encoding and decoding according to COBS methods.

What Is COBS?

COBS is a method of encoding a packet of bytes into a form that contains no bytes with value zero (0x00). The input packet of bytes can contain bytes in the full range of 0x00 to 0xFF. The COBS encoded packet is guaranteed to generate packets with bytes only in the range 0x01 to 0xFF. Thus, in a communication protocol, packet boundaries can be reliably delimited with 0x00 bytes.

The COBS encoding does have to increase the packet size to achieve this encoding. However, compared to other byte-stuffing methods, the packet size increase is reasonable and predictable. COBS always adds 1 byte to the message length. Additionally, for longer packets of length n, it may add n/254 (rounded down) additional bytes to the encoded packet size.

For example, compare to the PPP protocol, which uses 0x7E bytes to delimit PPP packets. The PPP protocol uses an “escape” style of byte stuffing, replacing all occurences of 0x7E bytes in the packet with 0x7D 0x5E. But that byte-stuffing method can potentially double the size of the packet in the worst case. COBS uses a different method for byte-stuffing, which has a much more reasonable worst-case overhead.

COBS/R

I have included a variant on COBS, which I am calling “Consistent Overhead Byte Stuffing—Reduced” (COBS/R). It is a small variation that can often avoid the +1 byte overhead that occurs in COBS, thus decreasing the average encoding overhead. Yet it does not increase the worst-case encoding overhead compared to COBS. See the COBS/R documentation for full details.

Complete cobs documentation is at https://pythonhosted.org/cobs/

Release History

Release History

This version
History Node

1.1.3

History Node

1.1.2

History Node

1.1.1

History Node

1.0.0

History Node

0.8.0

History Node

0.7.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
cobs-1.1.3.tar.gz (21.5 kB) Copy SHA256 Checksum SHA256 Source May 4, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting