Golang encoding/ascii85.MaxEncodedLen function example

package encoding/ascii85

MaxEncodedLen returns the maximum length of an encoding of n source bytes.

Golang encoding/ascii85.MaxEncodedLen function usage example

 str :=  []byte("some silly string to be encoded to ascii85")

 buffer := make([]byte, ascii85.MaxEncodedLen(len(str)))

 encodedbytes := ascii85.Encode(buffer, str)

Reference :

http://golang.org/pkg/encoding/ascii85/#MaxEncodedLen

  See also : Golang encoding/ascii85.Encode function example

Advertisement