Skip to content

Instantly share code, notes, and snippets.

@akovardin
Forked from sergiotapia/md5-example.go
Last active July 26, 2018 17:31
Show Gist options
  • Save akovardin/54bd5c05da7eaf5080bd34818ba88053 to your computer and use it in GitHub Desktop.
Save akovardin/54bd5c05da7eaf5080bd34818ba88053 to your computer and use it in GitHub Desktop.
Go MD5 string
import (
"crypto/md5"
"encoding/hex"
)
func GetMD5Hash(text string) string {
hasher := md5.New()
hasher.Write([]byte(text))
return hex.EncodeToString(hasher.Sum(nil))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment