Content deleted Content added
→Encoding examples: clarified and simplified |
→Encoding examples: mv highlight comment |
||
Line 39:
These examples show how various data sequences would be encoded by the COBS algorithm. In the examples, all bytes are expressed as [[hexadecimal]] values, and encoded data is shown with text formatting to illustrate various features:
* An {{red|overhead byte}} appears at the beginning of every encoded packet. This byte does not correspond to a data byte; it is an additional byte that is prepended to the encoded output. Its value equals either (1) one plus the number of non-zero data bytes that follow, or (2) one plus the total number of data bytes (applies when no zero bytes occur in the data). It is effectively a pointer to the next packet byte that requires interpretation: if the addressed byte is non-zero
* '''Bold''' indicates a data byte that has not been altered by encoding. All non-zero data bytes remain unaltered.
* {{green|Green}} indicates a data byte that was altered by encoding. All zero data bytes are replaced during encoding by one plus the number of non-zero bytes that follow.
|