Is there any sort of static method for obtaining the encode and decode size for data passed through HexEncoder, HexDecoder, Base64Encoder, Base64Decoder, Base32Encoder, and Base32Decoder?

If not, is there any reason anyone would be against adding such methods?


Much like the encryption classes have an CiphertextLength and MaxPlaintextLength, it would be much more convienient if these encoder and decoder classes has methods along the lines of EncodeLength and DecodeLength so that code, such as the following, did not have to be written to figure the actual lengths:

   ArraySink *sizeSink = new ArraySink(0, 0);
   Base64Encoder sizeEnc64(sizeSink);
   sizeEnc64.PutMessageEnd(NULL, sizeof(T));

   return sizeSink->TotalPutLength();


Are there any objections to having methods such as these?

virtual unsigned int EncodeLength(unsigned int dataLength) const = 0;
virtual unsigned int DecodeLength(unsigned int dataLength) const = 0;

- Jason

Reply via email to