MD5 is cryptographically broken and should not be used for security purposes; use SHA-256 instead. The standard library provides crypto/md5 for legacy compatibility, but crypto/sha256 is the recommended alternative.
package main
import (
"crypto/md5"
"fmt"
)
func main() {
data := []byte("example data")
hash := md5.Sum(data)
fmt.Printf("%x\n", hash)
}
Do not use this for passwords, signatures, or any security-sensitive data.