otfe/misc/b64/b64.go

13 lines
253 B
Go
Raw Normal View History

2022-02-23 12:07:09 +00:00
package b64
import "encoding/base64"
func Encode(src string) string {
return base64.URLEncoding.EncodeToString([]byte(src))
}
func Decode(src string) (string, error) {
value, err := base64.URLEncoding.DecodeString(src)
return string(value), err
}