添加md5
This commit is contained in:
+5
-1
@@ -9,8 +9,12 @@ import (
|
|||||||
|
|
||||||
// 字符串的md5
|
// 字符串的md5
|
||||||
func Md5String(value string) string {
|
func Md5String(value string) string {
|
||||||
|
return Md5Byte([]byte(value))
|
||||||
|
}
|
||||||
|
|
||||||
|
func Md5Byte(b []byte) string {
|
||||||
m := md5.New()
|
m := md5.New()
|
||||||
m.Write([]byte(value))
|
m.Write(b)
|
||||||
return hex.EncodeToString(m.Sum(nil))
|
return hex.EncodeToString(m.Sum(nil))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user