Standard library / encoding/ascii85

encoding/ascii85.MaxEncodedLen()

Compute an upper bound for the ASCII85 output buffer. Full four-byte groups need at most five characters; zero groups may compress to z. Expected stdout: '5 10\n'.

Formal Syntax & Structure

go syntaxgo
func MaxEncodedLen(n int) int

Parameters & Attributes

NameTypeDescription
nintNumber of input bytes.

Return Value

int

Byte count or length bound, as specified by the operation.

Working Example

Example Snippetgo
package main
import (  "encoding/ascii85"  "fmt")
func must(e error) {  if e != nil {    panic(e)  }}
func main() { fmt.Println(ascii85.MaxEncodedLen(4), ascii85.MaxEncodedLen(5)) }
Go Reference