1 Star 1 Fork 0

any-call / gobase

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
base64.go 561 Bytes
一键复制 编辑 原始数据 按行查看 历史
jinhua 提交于 2023-12-12 14:16 . changed
package mycrypto
import "encoding/base64"
func Base64Encode(inputData []byte) string {
encodeString := base64.StdEncoding.EncodeToString(inputData)
return encodeString
}
func Base64DecodeWithString(inputStr string) []byte {
decodeBytes, err := base64.StdEncoding.DecodeString(inputStr)
if err != nil {
return nil
}
return decodeBytes
}
func Base64DecodeWithBytes(inputBytes []byte) []byte {
desBytes := make([]byte, len(inputBytes)*2)
_, err := base64.StdEncoding.Decode(desBytes, inputBytes)
if err != nil {
return nil
}
return desBytes
}
Go
1
https://gitee.com/any-call/gobase.git
git@gitee.com:any-call/gobase.git
any-call
gobase
gobase
v1.8.7

搜索帮助