Date: Wed, 26 Feb 2003 15:04:19 -0800
From: "Dan Kohn" <dan(_at_)dankohn(_dot_)com>
[...]
The other alternative is to expect encoders to be a little smarter to
always have a 998 line count rather than having it be probabilistic.
The encoder could process each octet one at a time, escape the six that
need to be, output the result while incrementing a counter by the number
of octets outputted (either 1 or 2), add a CRLF when the counter reaches
997, and then reset the counter.
This is what should be required. There's absolutely no reason to bet
on probabilities here when counting the output octets is so easy and
guarantees correct behavior even when faced with a smart adversary.
If there was a substantial amount of computation involved in counting
output octets, perhaps it would be worth considering. But compared to
deflate it's nothing. Don't waste your time on it.
Larry