md5.go 176 B

12345678910111213
  1. package util
  2. import (
  3. "crypto/md5"
  4. "encoding/hex"
  5. )
  6. func EncodeMD5(value string) string {
  7. m := md5.New()
  8. m.Write([]byte(value))
  9. return hex.EncodeToString(m.Sum(nil))
  10. }