dddd
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
386 B

package commonus
// import (
// "crypto/md5"
// "exam_server/config"
// "fmt"
// )
// func Md5(str string, key ...string) string {
// key_val := config.AppConfig.AppKey
// if len(key) > 0 {
// key_val = key[0]
// }
// str = str + key_val
// data := []byte(str)
// has := md5.Sum(data)
// md5str1 := fmt.Sprintf("%x", has) //将[]byte转成16进制
// return md5str1
// }