1 Star 4 Fork 2

tym_hmm / go-helper

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Md5.go 322 Bytes
一键复制 编辑 原始数据 按行查看 历史
package EncryptMd5
import (
"crypto/md5"
"fmt"
"io"
)
/**
md5通用加密
*/
func Md5(dataBytes string) (string, error) {
md5Util := md5.New()
_, err := io.WriteString(md5Util, dataBytes)
if err != nil {
return "", err
}
endBytes:= md5Util.Sum(nil)
md5Str:= fmt.Sprintf("%x", endBytes)
return md5Str, nil
}
Go
1
https://gitee.com/tym_hmm/go-helper.git
git@gitee.com:tym_hmm/go-helper.git
tym_hmm
go-helper
go-helper
v1.1.162

搜索帮助