import "crypto/md5" str := "sdsdas" data := []byte(str) hex := md5.Sum(data) str = fmt.Sprintf("%x", hex) // str就是加密后的md5值