Files
mir-godot/server/framework/utils/md5.go
2024-03-03 22:59:18 +08:00

23 lines
488 B
Go

/**
******************************************************************************
* @file md5.go
* @author MakerYang
******************************************************************************
*/
package Utils
import (
"crypto/md5"
"encoding/hex"
)
func MD5Hash(text string) string {
hash := md5.Sum([]byte(text))
return hex.EncodeToString(hash[:])
}
func VerifyPassword(storedPassword, inputPassword string) bool {
return MD5Hash(inputPassword) == storedPassword
}