3pl/util/base64/base64.go

16 lines
266 B
Go
Raw Permalink Normal View History

2022-08-15 04:51:07 +00:00
package base64
import b64 "encoding/base64"
// Encode ...
func Encode(data []byte) string {
sEnc := b64.StdEncoding.EncodeToString(data)
return sEnc
}
// Decode ...
func Decode(text string) []byte {
sDec, _ := b64.StdEncoding.DecodeString(text)
return sDec
}