We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
这里就放在工具函数中了,取名 md5.go
package utils import "golang.org/x/crypto/bcrypt" func EnCodeMD5(password string) string { // 生成 bcrypt 密码哈希 hashedPassword, err := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost) if err != nil { panic(err) } return string(hashedPassword) } func UnCodeMD5(password string, hashedPassword string) bool { err := bcrypt.CompareHashAndPassword([]byte(hashedPassword), []byte(password)) return err == nil }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
这里就放在工具函数中了,取名 md5.go
The text was updated successfully, but these errors were encountered: