1 Star 0 Fork 0

Hundred.Lee/openssl

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
md5.go 430 Bytes
一键复制 编辑 原始数据 按行查看 历史
Hundred.Lee 提交于 2020-09-17 15:47 +08:00 . first commit
package openssl
import (
"crypto/md5"
"encoding/hex"
)
// Md5 Calculate the md5 hash of a string
// If the optional rawOutput is set to true, then the md5 digest is instead returned in raw binary format with a length of 16.
func Md5(str string, rawOutput ...bool) string {
h := md5.New()
h.Write([]byte(str))
str = hex.EncodeToString(h.Sum(nil))
if len(rawOutput) > 0 && rawOutput[0] {
str = str[8:24]
}
return str
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hundredlee/openssl.git
git@gitee.com:hundredlee/openssl.git
hundredlee
openssl
openssl
964a66695895

搜索帮助