hello,
it seems to me that
TASCII85EncoderStream is bugged, it produces different output each time invoked.
given the string "test", each time invoked i get different 5-byte long ascii. (5 bytes is the correct output length for 4 bytes input, but the ascii it produces is incorrect)
side note: fcl documentation for
TASCII85EncoderStream does not mention what variant of ascii85 encoding is used.
also note that i mainly do procedural programming, and i seriously know nothing about OOP; despite that i still believe my code is correct:
function EncodeAscii85(aData: String): String;
var
asciiStream: TStringStream;
asciiEncoder: TASCII85EncoderStream;
asciiString: String;
begin
asciiStream := TStringStream.Create;
asciiEncoder := TASCII85EncoderStream.Create(asciiStream);
asciiEncoder.Write(aData, aData.Length);
asciiEncoder.Destroy;
asciiString := asciiStream.DataString;
asciiStream.Destroy;
EncodeAscii85 := asciiString;
end;