encoding/base64
Package base64
Overview
Package base64 implements base64 encoding as specified by RFC 4648.
Example
package main import ( "encoding/base64" "fmt" ) func main() { msg := "Hello, 世界" encoded := base64.StdEncoding.EncodeToString([]byte(msg)) fmt.Println(encoded) decoded, err := base64.StdEncoding.DecodeString(encoded) if err != nil { fmt.Println("decode error:", err) return } fmt.Println(string(decoded)) }