123456789101112131415161718 |
- package utils
- import (
- "encoding/base64"
- )
- func Base64Encode(src []byte) []byte {
- return []byte(base64.StdEncoding.EncodeToString(src))
- }
- func Base64Decode(src []byte) ([]byte, error) {
- return base64.StdEncoding.DecodeString(string(src))
- }
- func Base64DecodeStr(src string) ([]byte, error) {
- return base64.StdEncoding.DecodeString(src)
- }
|