Wei Dai wrote:
In the case of encoders, you also have to take into account the
effects of the Grouper class. For decoders, characters outside the
encoding alphabet are ignored, so the decoded length is unpredictable.
Then the following functions would be applicable:
unsigned int EncodeLength(unsigned int dataLength);
unsigned int DecodeLength(const void *data, unsigned int dataLength);
unsigned int DecodeLengthMax(unsigned int dataLength);
I do not see the point in adding unnecessary overhead or
reinventing/reimplementing the wheel every time for everyone. The first
and last of these functions can be implemented directly as integer
arithmetic. The second function can be implemented without any expected
buffer output.
- Jason