Go Base64 Encoding

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9

Syntax

  • func (enc *base64.Encoding) Encode(dst, src []byte)
  • func (enc *base64.Encoding) Decode(dst, src []byte) (n int, err error)
  • func (enc *base64.Encoding) EncodeToString(src []byte) string
  • func (enc *base64.Encoding) DecodeString(s string) ([]byte, error)

Remarks

The encoding/base64 package contains several built in encoders. Most of the examples in this document will use base64.StdEncoding, but any encoder (URLEncoding, RawStdEncodign, your own custom encoder, etc.) may be substituted.



Got any Go Question?