forked from ebhomengo/niki
1
0
Fork 0
niki/vendor/github.com/brianvoe/gofakeit/v6/hacker.go

213 lines
4.5 KiB
Go
Raw Normal View History

2024-04-26 19:30:35 +00:00
package gofakeit
import (
"math/rand"
"strings"
)
// HackerPhrase will return a random hacker sentence
2024-04-26 19:30:35 +00:00
func HackerPhrase() string { return hackerPhrase(globalFaker.Rand) }
// HackerPhrase will return a random hacker sentence
2024-04-26 19:30:35 +00:00
func (f *Faker) HackerPhrase() string { return hackerPhrase(f.Rand) }
func hackerPhrase(r *rand.Rand) string {
2024-04-26 19:30:35 +00:00
words := strings.Split(generate(r, getRandValue(r, []string{"hacker", "phrase"})), " ")
2024-04-26 19:30:35 +00:00
words[0] = strings.ToUpper(words[0][0:1]) + words[0][1:]
2024-04-26 19:30:35 +00:00
return strings.Join(words, " ")
2024-04-26 19:30:35 +00:00
}
// HackerAbbreviation will return a random hacker abbreviation
2024-04-26 19:30:35 +00:00
func HackerAbbreviation() string { return hackerAbbreviation(globalFaker.Rand) }
// HackerAbbreviation will return a random hacker abbreviation
2024-04-26 19:30:35 +00:00
func (f *Faker) HackerAbbreviation() string { return hackerAbbreviation(f.Rand) }
func hackerAbbreviation(r *rand.Rand) string {
2024-04-26 19:30:35 +00:00
return getRandValue(r, []string{"hacker", "abbreviation"})
2024-04-26 19:30:35 +00:00
}
// HackerAdjective will return a random hacker adjective
2024-04-26 19:30:35 +00:00
func HackerAdjective() string { return hackerAdjective(globalFaker.Rand) }
// HackerAdjective will return a random hacker adjective
2024-04-26 19:30:35 +00:00
func (f *Faker) HackerAdjective() string { return hackerAdjective(f.Rand) }
func hackerAdjective(r *rand.Rand) string {
2024-04-26 19:30:35 +00:00
return getRandValue(r, []string{"hacker", "adjective"})
2024-04-26 19:30:35 +00:00
}
// HackerNoun will return a random hacker noun
2024-04-26 19:30:35 +00:00
func HackerNoun() string { return hackerNoun(globalFaker.Rand) }
// HackerNoun will return a random hacker noun
2024-04-26 19:30:35 +00:00
func (f *Faker) HackerNoun() string { return hackerNoun(f.Rand) }
func hackerNoun(r *rand.Rand) string {
2024-04-26 19:30:35 +00:00
return getRandValue(r, []string{"hacker", "noun"})
2024-04-26 19:30:35 +00:00
}
// HackerVerb will return a random hacker verb
2024-04-26 19:30:35 +00:00
func HackerVerb() string { return hackerVerb(globalFaker.Rand) }
// HackerVerb will return a random hacker verb
2024-04-26 19:30:35 +00:00
func (f *Faker) HackerVerb() string { return hackerVerb(f.Rand) }
func hackerVerb(r *rand.Rand) string {
2024-04-26 19:30:35 +00:00
return getRandValue(r, []string{"hacker", "verb"})
2024-04-26 19:30:35 +00:00
}
// HackeringVerb will return a random hacker ingverb
2024-04-26 19:30:35 +00:00
func HackeringVerb() string { return hackeringVerb(globalFaker.Rand) }
// HackeringVerb will return a random hacker ingverb
2024-04-26 19:30:35 +00:00
func (f *Faker) HackeringVerb() string { return hackeringVerb(f.Rand) }
func hackeringVerb(r *rand.Rand) string {
2024-04-26 19:30:35 +00:00
return getRandValue(r, []string{"hacker", "ingverb"})
2024-04-26 19:30:35 +00:00
}
func addHackerLookup() {
2024-04-26 19:30:35 +00:00
AddFuncLookup("hackerphrase", Info{
Display: "Hacker Phrase",
Category: "hacker",
2024-04-26 19:30:35 +00:00
Description: "Informal jargon and slang used in the hacking and cybersecurity community",
Example: "If we calculate the program, we can get to the AI pixel through the redundant XSS matrix!",
Output: "string",
2024-04-26 19:30:35 +00:00
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
2024-04-26 19:30:35 +00:00
return hackerPhrase(r), nil
2024-04-26 19:30:35 +00:00
},
})
AddFuncLookup("hackerabbreviation", Info{
Display: "Hacker Abbreviation",
Category: "hacker",
2024-04-26 19:30:35 +00:00
Description: "Abbreviations and acronyms commonly used in the hacking and cybersecurity community",
Example: "ADP",
Output: "string",
2024-04-26 19:30:35 +00:00
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
2024-04-26 19:30:35 +00:00
return hackerAbbreviation(r), nil
2024-04-26 19:30:35 +00:00
},
})
AddFuncLookup("hackeradjective", Info{
Display: "Hacker Adjective",
Category: "hacker",
2024-04-26 19:30:35 +00:00
Description: "Adjectives describing terms often associated with hackers and cybersecurity experts",
Example: "wireless",
Output: "string",
2024-04-26 19:30:35 +00:00
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
2024-04-26 19:30:35 +00:00
return hackerAdjective(r), nil
2024-04-26 19:30:35 +00:00
},
})
AddFuncLookup("hackernoun", Info{
Display: "Hacker Noun",
Category: "hacker",
2024-04-26 19:30:35 +00:00
Description: "Noun representing an element, tool, or concept within the realm of hacking and cybersecurity",
Example: "driver",
Output: "string",
2024-04-26 19:30:35 +00:00
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
2024-04-26 19:30:35 +00:00
return hackerNoun(r), nil
2024-04-26 19:30:35 +00:00
},
})
AddFuncLookup("hackerverb", Info{
Display: "Hacker Verb",
Category: "hacker",
2024-04-26 19:30:35 +00:00
Description: "Verbs associated with actions and activities in the field of hacking and cybersecurity",
Example: "synthesize",
Output: "string",
2024-04-26 19:30:35 +00:00
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
2024-04-26 19:30:35 +00:00
return hackerVerb(r), nil
2024-04-26 19:30:35 +00:00
},
})
AddFuncLookup("hackeringverb", Info{
Display: "Hackering Verb",
Category: "hacker",
2024-04-26 19:30:35 +00:00
Description: "Verb describing actions and activities related to hacking, often involving computer systems and security",
Example: "connecting",
Output: "string",
2024-04-26 19:30:35 +00:00
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
2024-04-26 19:30:35 +00:00
return hackeringVerb(r), nil
2024-04-26 19:30:35 +00:00
},
})
2024-04-26 19:30:35 +00:00
}