Golang encoding/base32.NewDecoder function examples

package encoding/base32

NewDecoder constructs a new base32 stream decoder.

Golang encoding/base32.NewDecoder function usage examples

Example 1: (with base32.HexEncoding see http://golang.org/pkg/encoding/base32/#pkg-variables )

 var text []byte
 decoder := base32.NewDecoder(base32.HexEncoding, bytes.NewBuffer(text))

Example 2: (with base32.StdEncoding see http://golang.org/pkg/encoding/base32/#pkg-variables )

 decoder := base32.NewDecoder(base32.StdEncoding, strings.NewReader(encoded))

References :

http://golang.org/pkg/encoding/base32/#NewDecoder

Advertisement