Golang DecodeString()

Decode an input String using Base64.

Function

func (enc *Encoding) DecodeString(s string) ([]byte, error)

Parameters

s - The String to be decoded

Return value

DecodeString returns the bytes represented by the base64 string s.

Example

package main
import b64 "encoding/base64"

func main() {
  data := "YmFzZTY0IGVuY29kZWQgc3RyaW5n"
  sDec := b64.StdEncoding.DecodeString(data)
}

Github

See also: