Skip to content

Instantly share code, notes, and snippets.

@xigang
Last active March 10, 2016 06:53
Show Gist options
  • Select an option

  • Save xigang/a3d7d653d4fc50d030f7 to your computer and use it in GitHub Desktop.

Select an option

Save xigang/a3d7d653d4fc50d030f7 to your computer and use it in GitHub Desktop.
MD5加密
func MD5(s string) string {
h := md5.New()
h.Write([]byte(s))
return hex.EncodeToString(h.Sum(nil))
}
func TwiceMD5(s string) string {
return MD5(MD5(s))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment