下面這個工具包下的函數
package utils import ( "crypto/md5" "encoding/hex" ) //md5加密 func Md5(src string) string { m := md5.New() m.Write([]byte(src)) res := hex.EncodeToString(m.Sum(nil)) return res }
pass:=utils.Md5("test")
下面這個工具包下的函數
package utils import ( "crypto/md5" "encoding/hex" ) //md5加密 func Md5(src string) string { m := md5.New() m.Write([]byte(src)) res := hex.EncodeToString(m.Sum(nil)) return res }
pass:=utils.Md5("test")
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。