Skip to main content

Consistent Overhead Byte Stuffing (COBS)

Project description

Author:

Craig McQueen

Contact:
http://craig.mcqueen.id.au/

Python functions for encoding and decoding COBS.

Complete cobs documentation is at http://packages.python.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 http://packages.python.org/cobs/

Project details


Download files

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

Source Distributions

cobs-0.8.0.zip (32.3 kB view details)

Uploaded Source

cobs-0.8.0.tar.gz (17.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

cobs-0.8.0.win32-py3.1.msi (131.1 kB view details)

Uploaded Source

cobs-0.8.0.win32-py2.6.msi (131.1 kB view details)

Uploaded Source

cobs-0.8.0.win32-py2.5.msi (131.1 kB view details)

Uploaded Source

cobs-0.8.0.win32-py2.4.exe (79.9 kB view details)

Uploaded Source

File details

Details for the file cobs-0.8.0.zip.

File metadata

  • Download URL: cobs-0.8.0.zip
  • Upload date:
  • Size: 32.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cobs-0.8.0.zip
Algorithm Hash digest
SHA256 534504bc065cc3aab22edea19a05094157a026629ea954465eb3dd58b97fbb21
MD5 b0c0abebfc8b89410e3bb45c365bcd07
BLAKE2b-256 b9cc479de12b14b6ac5dd6a878ea58596c156908f3940e5ddb7228b99a0150c4

See more details on using hashes here.

File details

Details for the file cobs-0.8.0.tar.gz.

File metadata

  • Download URL: cobs-0.8.0.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cobs-0.8.0.tar.gz
Algorithm Hash digest
SHA256 582e37b87fac9c26275b4374e1b8f3231a76694377dc4850733ab62330cdb02a
MD5 cc76a062d7cdea43cbfbf4cc5c591a92
BLAKE2b-256 d292be23736bc6918bbc6c9fcaafa0f732f86f7afc67ae39e10b7d06f1e46db9

See more details on using hashes here.

File details

Details for the file cobs-0.8.0.win32-py3.1.msi.

File metadata

  • Download URL: cobs-0.8.0.win32-py3.1.msi
  • Upload date:
  • Size: 131.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cobs-0.8.0.win32-py3.1.msi
Algorithm Hash digest
SHA256 3226dc502fa262fd43141a48e676cfc4586895431aefdf8e44a06be497a76c0f
MD5 af228c06cd2b599cdd6e22097c4d73b8
BLAKE2b-256 22424d64aeac5e3dfb35577084cc4ba569f8cc8e864eba13ea0143dfa25778dc

See more details on using hashes here.

File details

Details for the file cobs-0.8.0.win32-py2.6.msi.

File metadata

  • Download URL: cobs-0.8.0.win32-py2.6.msi
  • Upload date:
  • Size: 131.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cobs-0.8.0.win32-py2.6.msi
Algorithm Hash digest
SHA256 149e0d9f3f5150d27ccd8f2fbe3c8933d9d31cc3b1d64d5eeb7641dd33e6ba6a
MD5 9d402f3236729917b7ccbcb2ae024c46
BLAKE2b-256 092525085db4241f507294bf3f0029e73512b0135c20887bfc44f136f0b7e7fa

See more details on using hashes here.

File details

Details for the file cobs-0.8.0.win32-py2.5.msi.

File metadata

  • Download URL: cobs-0.8.0.win32-py2.5.msi
  • Upload date:
  • Size: 131.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cobs-0.8.0.win32-py2.5.msi
Algorithm Hash digest
SHA256 7c91236ca85bc8c332a285ae3301142bca74fa5b02533282d484ba691f719770
MD5 3c37536b8ce9bd89154cbdb513ca3500
BLAKE2b-256 9d03df3e45f18871ac1e3fbebbc53fa4047cdaa7952761fc51ef88f82c88d5b9

See more details on using hashes here.

File details

Details for the file cobs-0.8.0.win32-py2.4.exe.

File metadata

  • Download URL: cobs-0.8.0.win32-py2.4.exe
  • Upload date:
  • Size: 79.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cobs-0.8.0.win32-py2.4.exe
Algorithm Hash digest
SHA256 7abb2ff0a73df505bead01e84f69e653ddcadfd5ebe262cde7394a4066a59a5e
MD5 c10f533f3524f609084f37f1549f7156
BLAKE2b-256 e621fd2c9514fc81346afe8d7d55ca0a64bb8d22ad9b408137197c14b16a6f97

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page