Skip to content

Instantly share code, notes, and snippets.

@vuduongtp
Last active October 26, 2022 01:28
Show Gist options
  • Save vuduongtp/fafc38c508c6a29aad5b58a750ce8d7b to your computer and use it in GitHub Desktop.
Save vuduongtp/fafc38c508c6a29aad5b58a750ce8d7b to your computer and use it in GitHub Desktop.
Golang - MD5 Hash Encrypt
import (
"crypto/md5"
"encoding/hex"
)
func MD5Hash(text string) string {
hash := md5.Sum([]byte(text))
return hex.EncodeToString(hash[:])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment