package main import ( "crypto/md5" "fmt" ) func main() { data := []byte("hello world") hash := md5.Sum(data) fmt.Printf("MD5 Hash: %x\n", hash) }
package main import ( "crypto/sha256" "fmt" ) func main() { data := []byte("hello world") hash := sha256.Sum256(data) fmt.Printf("SHA256 Hash: %x\n", hash) }
package main import ( "golang.org/x/crypto/blake2b" "fmt" ) func main() { data := []byte("hello world") hash := blake2b.Sum512(data) fmt.Printf("Blake2b Hash: %x\n", hash) }In the examples, the following package libraries are being used: - md5: "crypto/md5" - sha256: "crypto/sha256" - blake2b: "golang.org/x/crypto/blake2b"