Created
January 2, 2017 13:55
-
-
Save bradberger/38755e643b1fb77973b4ab0faa9578af to your computer and use it in GitHub Desktop.
Golang - How to hash a string using MD5
This file contains 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
package main | |
import ( | |
"fmt" | |
"crypto/md5" | |
) | |
func GetMD5Hash(s string) string { | |
return fmt.Sprintf("%x", md5.Sum([]byte(s))) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment