You can use the crypto/md5 [docs] package in Go to perform MD5 encoding on a string. We have an example function below, it will take your string and write it as a hash. Then convert that binary back into a hexadecimal string using Sprintf. Note: There are more modern approaches than md5 these days - and it isn’t recommended for many things, but definitely not password hashing. Here’s an example of how to use it: