Base64 in Go

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

Internal

Overview

Decoding

base64EncodedStr := "..."
data, err := base64.StdEncoding.DecodeString(base64EncodedStr)
if err != nil {
    ...
}
s := string(data)

Encoding

base64EncodedStr := base64.StdEncoding.EncodeToString([]byte(str))