Standard library / encoding/base32

encoding/base32.Encoding.EncodeToString()

Return the encoded input as a new string using the configured alphabet and padding. Expected stdout: 'I5XQ====\n'.

Formal Syntax & Structure

go syntaxgo
func (enc *Encoding) EncodeToString(src []byte) string

Parameters & Attributes

NameTypeDescription
src[]byteInput bytes in the format expected by the operation.

Return Value

string

Text representation.

Working Example

Example Snippetgo
package main
import (  "encoding/base32"  "fmt")
func must(e error) {  if e != nil {    panic(e)  }}
func main() { fmt.Println(base32.StdEncoding.EncodeToString([]byte("Go"))) }
Go Reference