ascii85 has a function to get the maximum length of an encoding MaxEncodedLen().
I think that it should have too a function to get the length at decoding like it has in Base64.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here’s a function to calculate Go
package ascii85MaxDecodedLen()fornencoded bytes.If all four bytes of a unencoded group are zero, they are represented by a single byte, the character
z, instead of by five exclamation points (!!!!!). In some implementations, an unencoded group of spaces may be represented by the single charactery.ascii85.Decode(), unlikeascii85.Encode(), has number of bytes consumed (nsrc) andflushparameters, in addition to a number of bytes written (ndst) parameter, which allows the programmer to decode multiple blocks or a single block piece-by-piece. Therefore, a destination buffer of less than theMaxDecodedLen()may be used.