gin-blog/pkg/util/md5.go

14 lines
176 B
Go
Raw Permalink Normal View History

2021-05-28 10:41:12 +00: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))
}