Skip to content

Commit 7104cff

Browse files
committed
Improve README
1 parent 68adbb7 commit 7104cff

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,19 @@ a length byte. This requires a lookahead of up to 254 bytes when doing streaming
1313

1414
rCOBS outputs the length byte at the *end* of the chunk instead of at the start, completely
1515
eliminating the lookahead requirement for encoding. The tradeoff is decoding now has to be done starting
16-
from the *end* of the message backwards, so no lookahead is possible. The message has to be
17-
read in its entirety before it can be decoded.
16+
from the *end* of the message backwards, so streaming decode is not possible at all. The message has to be
17+
read in its entirety into a buffer before it can be decoded.
1818

1919
This makes rCOBS ideal for situations where data is *encoded* in constrained, embedded systems and *decoded* in
20-
more capable systems, where the full buffering requirement is not a problem.
20+
more capable systems, where the full buffering requirement is not a problem, such as:
21+
22+
- Logging
23+
- Crash reporting
24+
- Telemetry/monitoring
25+
- Sensor data feeds
26+
27+
This crate implements a streaming `no-std`-friendly encoder, and a non-streaming `std`-only decoder (enabled with `std` Cargo feature).
28+
`no-std` decoding is intentionally not provided: if you need to decode on embedded devices, standard COBS is a better fit for you.
2129

2230
## Examples
2331

@@ -31,12 +39,16 @@ rCOBS-encoded: 11 22 33 44 05
3139
Message: 11 22 00 33
3240
COBS-encoded: 03 11 22 02 33
3341
rCOBS-encoded: 11 22 03 33 02
34-
42+
Cr
3543
Message: 11 00 00 00 42 42 42
3644
COBS-encoded: 02 11 01 01 04 42 42 42
3745
rCOBS-encoded: 11 02 01 01 42 42 42 04
3846
```
3947

48+
## Credits
49+
50+
Idea of reversing COBS to allow encoding with no lookahead by @jamesmunns. Implementation by @dirbaio.
51+
4052
## License
4153

4254
This work is licensed under either of

0 commit comments

Comments
 (0)