1 Star 1 Fork 0

凡卡/utils

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
encoding.go 395 Bytes
一键复制 编辑 原始数据 按行查看 历史
凡卡 提交于 2022-07-26 09:37 +08:00 . test
package utils
import (
"encoding/base64"
"unsafe"
)
func EnBase64(bs []byte) string {
return base64.StdEncoding.EncodeToString(bs)
}
func DenBase64(str string) (bs []byte, err error) {
bs, err = base64.StdEncoding.DecodeString(str)
return
}
/*
把[]byte转换为string,只要性能,不在乎可读性
*/
func Bytes2string(b []byte) string {
return *(*string)(unsafe.Pointer(&b))
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/prestonTao/utils.git
git@gitee.com:prestonTao/utils.git
prestonTao
utils
utils
ff2eb0330898

搜索帮助