Skip to content

Instantly share code, notes, and snippets.

@manojktechie
manojktechie / md5-example.go
Created January 19, 2017 22:02 — forked from sergiotapia/md5-example.go
Golang - How to hash a string using MD5.
import (
"crypto/md5"
"encoding/hex"
)
func GetMD5Hash(text string) string {
hasher := md5.New()
hasher.Write([]byte(text))
return hex.EncodeToString(hasher.Sum(nil))
}