2808 explained code solutions for 75 technologies


golangHow to generate MD5 hash from string


package main

import (
  "fmt"
  "crypto/md5"
)

func main() {
  str := "Hi all!"

  hash := md5.Sum( []byte(str) )
  
  fmt.Printf("%x", hash)
}ctrl + c
package main

default package declaration

"crypto/md5"

package to calculate MD5 hashes

"Hi all!"

sample string to hash

md5.Sum

return MD5 hash from given value