File: match.go

package info (click to toggle)
golang-github-nbutton23-zxcvbn-go 0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,448 kB
  • sloc: makefile: 6
file content (40 lines) | stat: -rw-r--r-- 678 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package match

type Matches []Match

func (s Matches) Len() int {
	return len(s)
}
func (s Matches) Swap(i, j int) {
	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
	}
}

type Match struct {
	Pattern        string
	I, J           int
	Token          string
	DictionaryName string
	Entropy        float64
}

type DateMatch struct {
	Pattern          string
	I, J             int
	Token            string
	Separator        string
	Day, Month, Year int64
}

type Matcher struct {
	MatchingFunc func(password string) []Match
	ID           string
}