light-core/util/md5.go

13 lines
175 B
Go
Raw Normal View History

2024-12-17 22:28:48 +08:00
package util
import (
"crypto/md5"
"encoding/hex"
)
func EncodeMD5(value string) string {
m := md5.New()
m.Write([]byte(value))
return hex.EncodeToString(m.Sum(nil))
}