13 lines
253 B
Go
13 lines
253 B
Go
|
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
|
||
|
}
|