Last active
March 10, 2016 06:53
-
-
Save xigang/a3d7d653d4fc50d030f7 to your computer and use it in GitHub Desktop.
MD5加密
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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