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-1.0.0.zip (34.9 kB view details)

Uploaded Source

cobs-1.0.0.tar.gz (20.2 kB view details)

Uploaded Source

Built Distributions

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

cobs-1.0.0.win32-py3.3.msi (131.1 kB view details)

Uploaded Source

cobs-1.0.0.win32-py3.2.msi (131.1 kB view details)

Uploaded Source

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

Uploaded Source

cobs-1.0.0.win32-py2.7.msi (131.1 kB view details)

Uploaded Source

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

Uploaded Source

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

Uploaded Source

File details

Details for the file cobs-1.0.0.zip.

File metadata

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

File hashes

Hashes for cobs-1.0.0.zip
Algorithm Hash digest
SHA256 5a7ca18b385e8d88d31c9a0acdd9eb5a32aa53b87c744b3108fc35d440b78319
MD5 6dbbe18666b8692937f0189b4b1b859c
BLAKE2b-256 e20680acabb719b1d31e184b06fe5b108a4cbb7763136e609c8d5e071fe18979

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for cobs-1.0.0.tar.gz
Algorithm Hash digest
SHA256 180724e540a5d5b0290070215000b3427dfa57c96397a0d6cf01d37350b608a2
MD5 1b7adb76d0d7e982be6a7f56e9865555
BLAKE2b-256 fdbfa02ccaaaa5fea33e960ea340ea3de04be801eef3fda1c4c35a1d302d82fd

See more details on using hashes here.

File details

Details for the file cobs-1.0.0.win32-py3.3.msi.

File metadata

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

File hashes

Hashes for cobs-1.0.0.win32-py3.3.msi
Algorithm Hash digest
SHA256 a8ca165831361c4597688149d5e65b03aa7dc4f9d8336a9f4fc4da55f0c1dbcb
MD5 f940b90f41f83e4369f4b387af9bfb31
BLAKE2b-256 022e006e01aac70e1dfa2f3b25494e50169f9010fc8e48dd2dd66a60053630e1

See more details on using hashes here.

File details

Details for the file cobs-1.0.0.win32-py3.2.msi.

File metadata

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

File hashes

Hashes for cobs-1.0.0.win32-py3.2.msi
Algorithm Hash digest
SHA256 54df3196b549248cd76e8220266c5a18e2aac4f0d1a7fabec732b233f958f00d
MD5 80ee64f801239921b365622d6991beb3
BLAKE2b-256 a0edff5376d169f7c2ebffb289c0dcebb6b9dbc02da30e5b891abc7fcd3a14a4

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for cobs-1.0.0.win32-py3.1.msi
Algorithm Hash digest
SHA256 4d78cac15cdaf08919725c365a83074e93fb2aec417e17b42bcc44ee970971c0
MD5 3ad2370701fd1302ae5f4d6b3cea1fbc
BLAKE2b-256 99faa5be43733aac36a52015f7fbd469f6f55f688f8c32694661882afce7d6d7

See more details on using hashes here.

File details

Details for the file cobs-1.0.0.win32-py2.7.msi.

File metadata

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

File hashes

Hashes for cobs-1.0.0.win32-py2.7.msi
Algorithm Hash digest
SHA256 8b94a82430e73db45c3445816a60458fbe9360896ed414e6c2148f08c88382c6
MD5 2c65d18d9eba654fbcd28d8dda1f8cdf
BLAKE2b-256 4f24776fd02831c3e02a90eea4e0be28f5efa86f400e1d8514c435146b90b4dc

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for cobs-1.0.0.win32-py2.6.msi
Algorithm Hash digest
SHA256 dfa686b7a5e871a545d34c0a2cab6a944729787325602cc1b38379ddf0bb2956
MD5 663333003b43419d10122944b48c7d70
BLAKE2b-256 3a8361c14afea6f3236e2743a9293a8e97af722a3a153b627fdbdbe22450890d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for cobs-1.0.0.win32-py2.5.msi
Algorithm Hash digest
SHA256 71620f0fd7f96f25e79951a447133ca72c523443f6e6a62d928688fe84737f0b
MD5 fbbf0251005b579e935297d63402a64a
BLAKE2b-256 6616cbecd78bef629cc022182249a9eef686a0ee9721064c716e81213618ae50

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