-
Notifications
You must be signed in to change notification settings - Fork 0
/
pattern.go
65 lines (52 loc) · 1.88 KB
/
pattern.go
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
Good usernames have specific patterns.
We offer the following ones:
- A: firstNameNumSeq
[firstname] + [numericSequence]
example: luna221
- B: firstNameRandWord
[firstname] + [randomWord]
example: maxtravels, laurastar
- C: firstNameRandWordNumSeq
[PatternB] + [numericSequence]
example: maxtravels9, laurastar200
- D: firstNameDotVerb
[firstname] + [.] + [verb]
example: jens.codes, jessie.travels
- E: randomWordTimesN
n * [randomWord]
example: mytravelhobby, coolmathgames
- F: randomWordTimesNnumSeq
[PatternE] + [numericSequence]
example: mytravelhobby4, coolmathgames24
- G: randomPermutation
[randomPermutation]
example: aural (laura)
- H: leetspeak
[leetspeak(PatternA-G)]
example: kyli3j33n3rsb1gg3stst4lk3r
*/
package main
// Pattern defines the different types of usernames we can generate.
type Pattern int
// An enumartion of different username generation Patterns.
const (
firstNameNumSeq Pattern = iota // A
firstNameRandWord // B
firstNameRandWordNumSeq // C
firstNameDotVerb // D
randomWordTimesN // E
randomWordTimesNnumSeq // F
randomPermutation // G
leetspeak // H
)
// PatternOptions combine parameters needed to generate the Patterns A-H.
type PatternOptions struct {
firstName string // First name of the user
numSeqLen int // How many numbers in a random numeric sequence
wordList []string // A list of random words for Patterns B, E
verbList []string // A list of random verbs for Pattern D
randWordCount int // How many random words to combine for Pattern E
wordToPermutate string // The word to permutate for Pattern G
enableL33tSp34k bool // Enable l33tsp34k for Pattern H
}