2015-10-06 18:43:37 +00:00
|
|
|
package match
|
|
|
|
|
|
|
|
type Matches []Match
|
2016-01-13 22:49:04 +00:00
|
|
|
|
|
|
|
func (s Matches) Len() int {
|
2015-10-06 18:43:37 +00:00
|
|
|
return len(s)
|
|
|
|
}
|
2016-01-13 22:49:04 +00:00
|
|
|
func (s Matches) Swap(i, j int) {
|
2015-10-06 18:43:37 +00:00
|
|
|
s[i], s[j] = s[j], s[i]
|
|
|
|
}
|
|
|
|
func (s Matches) Less(i, j int) bool {
|
|
|
|
if s[i].I < s[j].I {
|
|
|
|
return true
|
|
|
|
} else if s[i].I == s[j].I {
|
|
|
|
return s[i].J < s[j].J
|
|
|
|
} else {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
}
|
2016-01-13 22:49:04 +00:00
|
|
|
|
2015-10-06 18:43:37 +00:00
|
|
|
type Match struct {
|
2016-01-21 22:26:33 +00:00
|
|
|
Pattern string
|
|
|
|
I, J int
|
|
|
|
Token string
|
|
|
|
DictionaryName string
|
|
|
|
Entropy float64
|
2015-10-06 18:43:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type DateMatch struct {
|
|
|
|
Pattern string
|
|
|
|
I, J int
|
|
|
|
Token string
|
|
|
|
Separator string
|
|
|
|
Day, Month, Year int64
|
2016-01-13 22:49:04 +00:00
|
|
|
}
|
2017-11-02 13:14:31 +00:00
|
|
|
|
|
|
|
type Matcher struct {
|
|
|
|
MatchingFunc func(password string) []Match
|
|
|
|
ID string
|
|
|
|
}
|