Go language for MD5 encryption of strings

  • 2020-05-26 09:21:20
  • OfStack

This article illustrates the Go language for MD5 encryption of strings. Share with you for your reference. The specific implementation method is as follows:

package main
import (
    "crypto/md5"
    "fmt"
    "io"
)
func main() {
    h := md5.New()
    io.WriteString(h, "welcome to ofstack.com")
    fmt.Printf("%x", h.Sum(nil))
}

I hope this article has been helpful to your programming of Go language.


Related articles: