添加md5

This commit is contained in:
Yun
2024-03-15 22:19:09 +08:00
parent 8b8575566b
commit 9b3b9ae574
+5 -1
View File
@@ -9,8 +9,12 @@ import (
// 字符串的md5
func Md5String(value string) string {
return Md5Byte([]byte(value))
}
func Md5Byte(b []byte) string {
m := md5.New()
m.Write([]byte(value))
m.Write(b)
return hex.EncodeToString(m.Sum(nil))
}