Skip to content

Instantly share code, notes, and snippets.

@bradberger
Created January 2, 2017 13:55
Show Gist options
  • Save bradberger/38755e643b1fb77973b4ab0faa9578af to your computer and use it in GitHub Desktop.
Save bradberger/38755e643b1fb77973b4ab0faa9578af to your computer and use it in GitHub Desktop.
Golang - How to hash a string using MD5
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