1 Star 0 Fork 0

h79 / goutils

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
md5.go 526 Bytes
一键复制 编辑 原始数据 按行查看 历史
huqiuyun 提交于 2023-09-03 16:54 . build
package algorithm
import (
"crypto/md5"
"fmt"
)
// StringToMd5 string to md5
// Deprecated: this function Md5String
func StringToMd5(data string) string {
return fmt.Sprintf("%x", md5.Sum([]byte(data)))
}
// BytesToMd5 bytes to md5
// Deprecated: this function Md5Bytes
func BytesToMd5(data []byte) string {
return fmt.Sprintf("%x", md5.Sum(data))
}
func Md5String(data string) string {
return fmt.Sprintf("%x", md5.Sum([]byte(data)))
}
func Md5Bytes(data []byte) string {
return fmt.Sprintf("%x", md5.Sum(data))
}
Go
1
https://gitee.com/h79/goutils.git
git@gitee.com:h79/goutils.git
h79
goutils
goutils
v1.20.65

搜索帮助