Last active
October 26, 2022 01:28
-
-
Save vuduongtp/fafc38c508c6a29aad5b58a750ce8d7b to your computer and use it in GitHub Desktop.
Golang - MD5 Hash Encrypt
This file contains hidden or 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
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