github.com/jtzjtz/kit@v1.0.2/sign/md5.go (about)

     1  package sign
     2  
     3  import (
     4  	"crypto/md5"
     5  	"encoding/hex"
     6  )
     7  
     8  //计算MD5值
     9  func ToMd5(s string) string {
    10  	m := md5.New()
    11  	m.Write([]byte(s))
    12  	return hex.EncodeToString(m.Sum(nil))
    13  }