3 ms·
I found the section above the linked one (Comparison with other universal codes) most interesting: > Fibonacci coding has a useful property that sometimes make
by lucb1e 5y ago
I found the section above the linked one (Comparison with other universal codes) most interesting:
> Fibonacci coding has a useful property that sometimes makes it attractive in comparison to other universal codes: it is an example of a self-synchronizing code, making it easier to recover data from a damaged stream.
- rbanffy 5y agoCool. It’s like it has its own embedded clock pulses. Very nice.
- Sharlin 5y agoA more familiar example of a self-synchronizing (but non-universal) code is UTF-8, which guarantees that if you start decoding a bytestream in the middle of a codepoint, it's trivial to find the next codepoint boundary because initial bytes always start with either 0 or 11, and continuation bytes always start with 10.
- gautamcgoel 5y agoJust to make sure I understand, this assumes that you start decoding at the beginning of a byte, not halfway through a byte, correct?
- not2b 5y agoYes, the structure could still help resync if you have a bitstream and not a bytestream (you could identify the MSBs of bytes from their very different statistical behavior), but it isn't as trivial as skipping continuation bytes, those with '10' in the most significant position. You'd need to track all 8 shift positions until you find the one that looks like UTF-8.
- lucb1e 5y agoHoly crap I did not know that and always thought it must be such a pain to decode variable-length text! How did I go so long without knowing this, that's such a neat feature.