2021-08-09 22:58:09 +08:00
|
|
|
package models
|
|
|
|
|
|
|
|
import (
|
|
|
|
"math/rand"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2022-07-06 21:34:57 +08:00
|
|
|
// NAMES - list of names 4-7 chars in length
|
2021-08-09 22:58:09 +08:00
|
|
|
var NAMES = []string{
|
|
|
|
"logic",
|
|
|
|
"warrant",
|
|
|
|
"iconic",
|
|
|
|
"threat",
|
|
|
|
"strike",
|
2021-09-23 12:12:32 +08:00
|
|
|
"boy",
|
2021-08-09 22:58:09 +08:00
|
|
|
"vital",
|
|
|
|
"unity",
|
|
|
|
"audio",
|
|
|
|
"schemer",
|
|
|
|
"depth",
|
|
|
|
"gravitl",
|
|
|
|
"mystic",
|
|
|
|
"donkey",
|
|
|
|
"atomic",
|
|
|
|
"turtle",
|
|
|
|
"monkey",
|
|
|
|
"rabbit",
|
|
|
|
"static",
|
|
|
|
"mosaic",
|
|
|
|
"elite",
|
|
|
|
"stonks",
|
|
|
|
"doggy",
|
|
|
|
"python",
|
|
|
|
"mohawk",
|
|
|
|
"arctic",
|
|
|
|
"rival",
|
|
|
|
"vibes",
|
|
|
|
"delay",
|
|
|
|
"bridge",
|
|
|
|
"weeble",
|
|
|
|
"combat",
|
|
|
|
"animal",
|
|
|
|
"wobble",
|
|
|
|
"rubble",
|
|
|
|
"bucket",
|
|
|
|
"proof",
|
|
|
|
"worker",
|
|
|
|
"beetle",
|
|
|
|
"racket",
|
|
|
|
"equal",
|
|
|
|
"panda",
|
|
|
|
"antics",
|
|
|
|
"strong",
|
|
|
|
"forum",
|
|
|
|
"koala",
|
|
|
|
"anchor",
|
|
|
|
"ornery",
|
|
|
|
"indigo",
|
|
|
|
"schism",
|
|
|
|
"dragon",
|
|
|
|
"knight",
|
|
|
|
"bishop",
|
|
|
|
"laser",
|
|
|
|
"rhino",
|
|
|
|
"clutch",
|
|
|
|
"shark",
|
|
|
|
"leader",
|
|
|
|
"young",
|
|
|
|
"robot",
|
|
|
|
"squish",
|
|
|
|
"chimp",
|
|
|
|
"rocket",
|
|
|
|
"space",
|
|
|
|
"queen",
|
2021-08-10 04:18:24 +08:00
|
|
|
"royalty",
|
2021-08-09 22:58:09 +08:00
|
|
|
"flush",
|
|
|
|
"earth",
|
|
|
|
"planet",
|
|
|
|
"heart",
|
|
|
|
"droplet",
|
|
|
|
"dillon",
|
|
|
|
"saturn",
|
|
|
|
"pluto",
|
|
|
|
"school",
|
|
|
|
"alien",
|
|
|
|
"matte",
|
|
|
|
"dingo",
|
|
|
|
"meercat",
|
|
|
|
"cookie",
|
|
|
|
"snack",
|
|
|
|
"goose",
|
|
|
|
"pepper",
|
|
|
|
"melissa",
|
2021-08-10 04:18:24 +08:00
|
|
|
"alex",
|
|
|
|
"elon",
|
|
|
|
"yeet",
|
|
|
|
"meh",
|
|
|
|
"walrus",
|
|
|
|
"avatar",
|
|
|
|
"chicken",
|
|
|
|
"proton",
|
|
|
|
"mohawk",
|
|
|
|
"tattoo",
|
|
|
|
"zebra",
|
|
|
|
"star",
|
|
|
|
"butter",
|
|
|
|
"tango",
|
|
|
|
"homie",
|
|
|
|
"rambo",
|
|
|
|
"cosmo",
|
|
|
|
"bubbles",
|
|
|
|
"hulk",
|
|
|
|
"pluto",
|
|
|
|
"scooby",
|
|
|
|
"thanos",
|
|
|
|
"yoda",
|
|
|
|
"draco",
|
|
|
|
"goofy",
|
|
|
|
"ditto",
|
|
|
|
"puff",
|
|
|
|
"duck",
|
|
|
|
"mouse",
|
|
|
|
"akita",
|
|
|
|
"water",
|
|
|
|
"hound",
|
|
|
|
"baby",
|
|
|
|
"spider",
|
|
|
|
"squid",
|
|
|
|
"roach",
|
|
|
|
"crab",
|
|
|
|
"cougar",
|
|
|
|
"cyborg",
|
|
|
|
"android",
|
|
|
|
"being",
|
|
|
|
"ninja",
|
|
|
|
"unicorn",
|
|
|
|
"zombie",
|
|
|
|
"warrior",
|
|
|
|
"zamboni",
|
|
|
|
"life",
|
|
|
|
"marine",
|
|
|
|
"node",
|
|
|
|
"mother",
|
|
|
|
"father",
|
|
|
|
"tesla",
|
2021-08-09 22:58:09 +08:00
|
|
|
}
|
|
|
|
|
2022-07-06 21:34:57 +08:00
|
|
|
// SMALL_NAMES - list of small (4 char or less) names
|
2021-08-09 22:58:09 +08:00
|
|
|
var SMALL_NAMES = []string{
|
|
|
|
"ace",
|
2021-08-10 04:18:24 +08:00
|
|
|
"odd",
|
|
|
|
"hot",
|
|
|
|
"ill",
|
2021-08-09 22:58:09 +08:00
|
|
|
"root",
|
|
|
|
"sudo",
|
|
|
|
"moon",
|
|
|
|
"beef",
|
|
|
|
"bro",
|
|
|
|
"dank",
|
|
|
|
"red",
|
|
|
|
"gold",
|
|
|
|
"big",
|
|
|
|
"old",
|
|
|
|
"og",
|
|
|
|
"best",
|
|
|
|
"blue",
|
|
|
|
"lil",
|
|
|
|
"mom",
|
|
|
|
"bot",
|
|
|
|
"evil",
|
|
|
|
"good",
|
|
|
|
"holy",
|
|
|
|
"rad",
|
|
|
|
"bad",
|
|
|
|
"sad",
|
|
|
|
"mad",
|
|
|
|
"chad",
|
|
|
|
"pre",
|
|
|
|
"post",
|
|
|
|
"foot",
|
|
|
|
"soft",
|
|
|
|
"hard",
|
|
|
|
"lite",
|
|
|
|
"dark",
|
|
|
|
"true",
|
|
|
|
"toy",
|
|
|
|
"soy",
|
|
|
|
"rude",
|
|
|
|
"nice",
|
2021-08-10 04:18:24 +08:00
|
|
|
"fun",
|
|
|
|
"fat",
|
|
|
|
"pro",
|
|
|
|
"sly",
|
|
|
|
"tan",
|
|
|
|
"pet",
|
|
|
|
"fine",
|
|
|
|
"main",
|
|
|
|
"last",
|
|
|
|
"wide",
|
|
|
|
"free",
|
|
|
|
"open",
|
|
|
|
"poor",
|
|
|
|
"rich",
|
|
|
|
"next",
|
|
|
|
"real",
|
|
|
|
"long",
|
|
|
|
"huge",
|
|
|
|
"wild",
|
|
|
|
"sick",
|
|
|
|
"weak",
|
|
|
|
"firm",
|
|
|
|
"pink",
|
|
|
|
"okay",
|
|
|
|
"dull",
|
|
|
|
"loud",
|
|
|
|
"lazy",
|
|
|
|
"dumb",
|
|
|
|
"tidy",
|
|
|
|
"idle",
|
|
|
|
"bony",
|
|
|
|
"cute",
|
|
|
|
"oily",
|
|
|
|
"lame",
|
|
|
|
"mega",
|
|
|
|
"limp",
|
|
|
|
"wavy",
|
|
|
|
"edgy",
|
|
|
|
"nosy",
|
|
|
|
"zany",
|
|
|
|
"base",
|
|
|
|
"cold",
|
2021-08-09 22:58:09 +08:00
|
|
|
}
|
|
|
|
|
2022-09-14 03:25:56 +08:00
|
|
|
var logoString = retrieveLogo()
|
|
|
|
|
2022-07-06 21:34:57 +08:00
|
|
|
// GenerateNodeName - generates a random node name
|
2021-08-09 22:58:09 +08:00
|
|
|
func GenerateNodeName() string {
|
|
|
|
rand.Seed(time.Now().UnixNano())
|
2021-08-10 03:08:53 +08:00
|
|
|
return SMALL_NAMES[rand.Intn(len(SMALL_NAMES))] + "-" + NAMES[seededRand.Intn(len(NAMES))]
|
2021-08-09 22:58:09 +08:00
|
|
|
}
|
2021-08-10 02:56:27 +08:00
|
|
|
|
2022-07-06 21:34:57 +08:00
|
|
|
// RetrieveLogo - retrieves the ascii art logo for Netmaker
|
2021-08-10 02:56:27 +08:00
|
|
|
func RetrieveLogo() string {
|
2022-09-14 03:25:56 +08:00
|
|
|
return logoString
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetLogo - sets the logo ascii art
|
|
|
|
func SetLogo(logo string) {
|
|
|
|
logoString = logo
|
|
|
|
}
|
|
|
|
|
|
|
|
func retrieveLogo() string {
|
2022-07-06 21:34:57 +08:00
|
|
|
return `
|
2021-08-10 02:56:27 +08:00
|
|
|
__ __ ______ ______ __ __ ______ __ __ ______ ______
|
|
|
|
/\ "-.\ \ /\ ___\ /\__ _\ /\ "-./ \ /\ __ \ /\ \/ / /\ ___\ /\ == \
|
|
|
|
\ \ \-. \ \ \ __\ \/_/\ \/ \ \ \-./\ \ \ \ __ \ \ \ _"-. \ \ __\ \ \ __<
|
|
|
|
\ \_\\"\_\ \ \_____\ \ \_\ \ \_\ \ \_\ \ \_\ \_\ \ \_\ \_\ \ \_____\ \ \_\ \_\
|
|
|
|
\/_/ \/_/ \/_____/ \/_/ \/_/ \/_/ \/_/\/_/ \/_/\/_/ \/_____/ \/_/ /_/
|
|
|
|
|
|
|
|
`
|
|
|
|
}
|