mirror of
https://gitee.com/lauix/HFish
synced 2025-05-14 05:38:02 +08:00
13 lines
164 B
Go
13 lines
164 B
Go
|
package md5
|
||
|
|
||
|
import (
|
||
|
"crypto/md5"
|
||
|
"encoding/hex"
|
||
|
)
|
||
|
|
||
|
func Md5(str string) string {
|
||
|
h := md5.New()
|
||
|
h.Write([]byte(str))
|
||
|
return hex.EncodeToString(h.Sum(nil))
|
||
|
}
|