Skip to content

Commit

Permalink
hot fix
Browse files Browse the repository at this point in the history
hot fix a validation in IsMakeAFullMask
  • Loading branch information
JakeWnuk committed Nov 8, 2024
1 parent 650fda8 commit d5463ad
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/mask/mask.go
Original file line number Diff line number Diff line change
Expand Up @@ -649,19 +649,22 @@ func CalculateKeyspace(input string) int {
// Returns:
// (bool): True if the mask is a full mask, false if the mask is a partial mask
func IsMaskAFullMask(input string) bool {
if len(input)%2 != 0 {
return false
}

for i := 0; i < len(input); i += 2 {
if input[i] != '?' {
return false
}

if len(input) == 1 {
if i+1 >= len(input) {
return false
}

if input[i+1] != 'u' && input[i+1] != 'l' && input[i+1] != 'd' && input[i+1] != 's' && input[i+1] != 'b' && input[i+1] != 'a' {
return false
}

}

return true
Expand Down

0 comments on commit d5463ad

Please sign in to comment.