This commit is contained in:
lash 2025-01-21 15:59:44 +00:00
parent ba8cbbccea
commit 9fbae0471f
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
5 changed files with 9 additions and 9 deletions

View File

@ -3,6 +3,7 @@ package identity
import (
"regexp"
)
// Define the regex patterns as constants
const (
addressRegex = `^0x[a-fA-F0-9]{40}$`

View File

@ -39,7 +39,6 @@ func CalculateAgeWithYOB(yob int) int {
return currentYear - yob
}
// IsValidYob checks if the provided yob can be considered valid
func IsValidYOb(yob string) bool {
currentYear := time.Now().Year()

View File

@ -8,6 +8,7 @@ import (
// Define the regex patterns as constants
const (
// TODO: This should rather use a phone package to determine whether valid phone number for any region.
phoneRegex = `^(?:\+254|254|0)?((?:7[0-9]{8})|(?:1[01][0-9]{7}))$`
)

View File

@ -12,7 +12,6 @@ const (
//Allowed incorrect PIN attempts
AllowedPINAttempts = uint8(3)
)
// checks whether the given input is a 4 digit number