md5.go 201 B

12345678910111213
  1. package utils
  2. import (
  3. "crypto/md5"
  4. "encoding/hex"
  5. )
  6. func MD5(password string) string {
  7. bytes := []byte(password)
  8. sum := md5.Sum(bytes)
  9. toString := hex.EncodeToString(sum[:])
  10. return toString
  11. }