diff --git a/.idea/GOHCache.xml b/.idea/GOHCache.xml index ac86a46..4319817 100644 --- a/.idea/GOHCache.xml +++ b/.idea/GOHCache.xml @@ -383,7 +383,7 @@ - diff --git a/utils/bcrypt.go b/utils/bcrypt.go index 4ff8e8e..b9c6648 100644 --- a/utils/bcrypt.go +++ b/utils/bcrypt.go @@ -3,6 +3,7 @@ package utils import ( "fmt" + "github.com/gogf/gf/v2/crypto/gmd5" "golang.org/x/crypto/bcrypt" ) @@ -21,3 +22,11 @@ func ValidPassword(hashPassword, password string) error { } return nil } + +func Md5Password(password string) string { + md5pass, err := gmd5.EncryptString(password) + if err != nil { + return "" + } + return md5pass +}