changes...

This commit is contained in:
KamilM1205 2025-09-22 22:12:49 +04:00
parent 41944884b4
commit ab4b53fd40
26 changed files with 600 additions and 51 deletions

View file

@ -0,0 +1,25 @@
package utils
import (
"unicode"
"github.com/go-playground/validator/v10"
)
func PasswordValidator(fl validator.FieldLevel) bool {
password := fl.Field().Interface().(string)
var hasUpper, hasNumber, hasLower = false, false, false
for _, c := range password {
if unicode.IsUpper(c) {
hasUpper = true
} else if unicode.IsLower(c) {
hasLower = true
} else if unicode.IsDigit(c) {
hasNumber = true
}
}
return hasUpper && hasNumber && hasLower
}