code-intelligence.com/cifuzz@v0.40.0/internal/names/names.go (about)

     1  package names
     2  
     3  import (
     4  	"crypto/sha256"
     5  	"encoding/binary"
     6  	"math/rand"
     7  )
     8  
     9  // these lists of names and adjectives are (partly) copied from:
    10  // https://github.com/moby/moby/tree/master/pkg/namesgenerator
    11  // https://github.com/fcrespo82/ubuntu-name-generator/tree/master/src/app
    12  var (
    13  	left = [...]string{
    14  		"able",
    15  		"admiring",
    16  		"adventurous",
    17  		"adoring",
    18  		"affectionate",
    19  		"agitated",
    20  		"amazing",
    21  		"angry",
    22  		"awesome",
    23  
    24  		"beautiful",
    25  		"blissful",
    26  		"bold",
    27  		"brave",
    28  		"brilliant",
    29  		"busy",
    30  
    31  		"charming",
    32  		"clever",
    33  		"cool",
    34  		"compassionate",
    35  		"competent",
    36  		"condescending",
    37  		"confident",
    38  		"crafty",
    39  		"cranky",
    40  
    41  		"dangerous",
    42  		"daunting",
    43  		"dazzling",
    44  		"determined",
    45  		"distracted",
    46  		"dreamy",
    47  		"dutiful",
    48  
    49  		"eager",
    50  		"ecstatic",
    51  		"elated",
    52  		"elegant",
    53  		"eloquent",
    54  		"epic",
    55  		"exciting",
    56  
    57  		"fantastic",
    58  		"festive",
    59  		"flying",
    60  		"focused",
    61  		"friendly",
    62  		"frosty",
    63  		"funky",
    64  		"funny",
    65  
    66  		"gallant",
    67  		"gifted",
    68  		"giggling",
    69  		"goofy",
    70  		"gracious",
    71  		"great",
    72  		"grinning",
    73  		"grumpy",
    74  
    75  		"happy",
    76  		"helpful",
    77  		"hilarious",
    78  		"hopeful",
    79  		"hungry",
    80  		"hyperactive",
    81  
    82  		"illustrious",
    83  		"impressive",
    84  		"incredible",
    85  		"infallible",
    86  		"ingenious",
    87  		"inspiring",
    88  		"intelligent",
    89  		"interesting",
    90  		"iridescent",
    91  
    92  		"jazzy",
    93  		"jittery",
    94  		"jolly",
    95  		"jovial",
    96  		"juggling",
    97  
    98  		"keen",
    99  		"kind",
   100  
   101  		"laughing",
   102  		"leaping",
   103  		"lovely",
   104  		"loving",
   105  		"lucid",
   106  
   107  		"magical",
   108  		"majestic",
   109  		"marvelous",
   110  		"mellow",
   111  		"merry",
   112  		"mighty",
   113  		"mystifying",
   114  		"modest",
   115  		"musical",
   116  		"mystical",
   117  
   118  		"nerdy",
   119  		"nervous",
   120  		"nice",
   121  		"nimble",
   122  		"nifty",
   123  		"nostalgic",
   124  
   125  		"obnoxious",
   126  		"objective",
   127  		"observing",
   128  		"odd",
   129  		"opportunistic",
   130  		"optimistic",
   131  
   132  		"peaceful",
   133  		"peachy",
   134  		"pedantic",
   135  		"pensive",
   136  		"philosophical",
   137  		"photogenic",
   138  		"poetic",
   139  		"practical",
   140  		"pragmatic",
   141  		"predictive",
   142  		"pretty",
   143  		"priceless",
   144  		"prickly",
   145  		"pristine",
   146  		"proud",
   147  
   148  		"quick",
   149  		"quiet",
   150  		"quirky",
   151  		"quizzical",
   152  
   153  		"radical",
   154  		"rational",
   155  		"reasonable",
   156  		"rebellious",
   157  		"relaxed",
   158  		"reverent",
   159  		"romantic",
   160  		"rowdy",
   161  
   162  		"serene",
   163  		"sharp",
   164  		"silly",
   165  		"sleepy",
   166  		"smooth",
   167  		"spectacular",
   168  		"spunky",
   169  		"stoic",
   170  		"strange",
   171  		"stressed",
   172  		"suspicious",
   173  		"sweet",
   174  
   175  		"temperamental",
   176  		"tender",
   177  		"thirsty",
   178  		"thoughtful",
   179  		"ticklish",
   180  		"tiny",
   181  		"tough",
   182  		"triumphant",
   183  		"trusting",
   184  		"trustworthy",
   185  		"twirling",
   186  
   187  		"unbelievable",
   188  		"understanding",
   189  		"unruffled",
   190  		"unruly",
   191  		"untamed",
   192  		"upbeat",
   193  
   194  		"veracious",
   195  		"vibrant",
   196  		"vigilant",
   197  		"vigorous",
   198  
   199  		"wandering",
   200  		"wild",
   201  		"witty",
   202  		"wizardly",
   203  		"wonderful",
   204  
   205  		"yodeling",
   206  		"youthful",
   207  
   208  		"zealous",
   209  		"zen",
   210  		"zooming",
   211  	}
   212  
   213  	right = [...]string{
   214  		"aal",
   215  		"albatross",
   216  		"alligator",
   217  		"alpaca",
   218  		"amoeba",
   219  		"anemone",
   220  		"angelfish",
   221  		"ant",
   222  		"anteater",
   223  		"antelope",
   224  		"ape",
   225  		"arachnid",
   226  		"armadillo",
   227  		"axolotl",
   228  
   229  		"baboon",
   230  		"badger",
   231  		"barnacle",
   232  		"barracuda",
   233  		"bat",
   234  		"beagle",
   235  		"bear",
   236  		"beaver",
   237  		"bee",
   238  		"beetle",
   239  		"bison",
   240  		"blackbird",
   241  		"blowfish",
   242  		"bobcat",
   243  		"bonobo",
   244  		"bull",
   245  		"bunny",
   246  
   247  		"camel",
   248  		"capybara",
   249  		"cardinal",
   250  		"caribou",
   251  		"cat",
   252  		"caterpillar",
   253  		"chameleon",
   254  		"cheetah",
   255  		"chickadee",
   256  		"chicken",
   257  		"chinchilla",
   258  		"chipmunk",
   259  		"chupacabra",
   260  		"cobra",
   261  		"condor",
   262  		"cow",
   263  		"coyote",
   264  		"crab",
   265  		"crane",
   266  		"crocodile",
   267  		"crow",
   268  
   269  		"deer",
   270  		"dodo",
   271  		"dog",
   272  		"dolphin",
   273  		"donkey",
   274  		"dove",
   275  		"duck",
   276  
   277  		"eagle",
   278  		"earthworm",
   279  		"eel",
   280  		"elephant",
   281  		"elk",
   282  		"emu",
   283  		"escargot",
   284  
   285  		"falcon",
   286  		"fawn",
   287  		"fennec",
   288  		"ferret",
   289  		"firefly",
   290  		"fish",
   291  		"flamingo",
   292  		"fly",
   293  		"fox",
   294  		"frog",
   295  
   296  		"gazelle",
   297  		"gecko",
   298  		"gerbil",
   299  		"gibbon",
   300  		"giraffe",
   301  		"gnat",
   302  		"gnu",
   303  		"goat",
   304  		"goose",
   305  		"gopher",
   306  		"gorilla",
   307  		"groundhog",
   308  		"gull",
   309  		"guppy",
   310  
   311  		"hamster",
   312  		"hare",
   313  		"hawk",
   314  		"hedgehog",
   315  		"hen",
   316  		"hornet",
   317  		"horse",
   318  		"hummingbird",
   319  		"husky",
   320  		"hyena",
   321  
   322  		"ibex",
   323  		"iguana",
   324  		"impala",
   325  
   326  		"jackal",
   327  		"jaguar",
   328  		"jay",
   329  		"jaybird",
   330  		"jellyfish",
   331  		"junebug",
   332  
   333  		"kangaroo",
   334  		"kingfisher",
   335  		"kitten",
   336  		"kiwi",
   337  		"koala",
   338  		"koi",
   339  		"kolibri",
   340  		"kookaburra",
   341  		"kouprey",
   342  		"kowari",
   343  		"kudu",
   344  
   345  		"labrador",
   346  		"ladybug",
   347  		"lamb",
   348  		"lemming",
   349  		"lemur",
   350  		"leopard",
   351  		"lion",
   352  		"lizard",
   353  		"llama",
   354  		"lobster",
   355  		"lynx",
   356  
   357  		"macaque",
   358  		"macaw",
   359  		"magpie",
   360  		"mallard",
   361  		"mammoth",
   362  		"manatee",
   363  		"manta",
   364  		"mantis",
   365  		"marmot",
   366  		"meerkat",
   367  		"mink",
   368  		"mockingbird",
   369  		"mole",
   370  		"monkey",
   371  		"moose",
   372  		"mouse",
   373  		"mule",
   374  
   375  		"narwhal",
   376  		"nightingale",
   377  		"nightjar",
   378  		"nutria",
   379  
   380  		"ocelot",
   381  		"octopus",
   382  		"okapi",
   383  		"opossum",
   384  		"orangutan",
   385  		"orca",
   386  		"ostrich",
   387  		"otter",
   388  		"owl",
   389  		"ox",
   390  		"oyster",
   391  
   392  		"panda",
   393  		"pangolin",
   394  		"panther",
   395  		"parakeet",
   396  		"parrot",
   397  		"peafowl",
   398  		"peccary",
   399  		"pelican",
   400  		"penguin",
   401  		"pheasant",
   402  		"pig",
   403  		"pigeon",
   404  		"piglet",
   405  		"piranha",
   406  		"platypus",
   407  		"polecat",
   408  		"porcupine",
   409  		"possum",
   410  		"primate",
   411  		"pronghorn",
   412  		"protozoa",
   413  		"puffin",
   414  		"puma",
   415  		"python",
   416  
   417  		"quokka",
   418  
   419  		"rabbit",
   420  		"raccoon",
   421  		"rattlesnake",
   422  		"raven",
   423  		"reindeer",
   424  		"rhea",
   425  		"rhino",
   426  		"roadrunner",
   427  		"rooster",
   428  
   429  		"salamander",
   430  		"salmon",
   431  		"scallop",
   432  		"scorpion",
   433  		"seagull",
   434  		"seahorse",
   435  		"seal",
   436  		"shark",
   437  		"sheep",
   438  		"sloth",
   439  		"snail",
   440  		"snake",
   441  		"sparrow",
   442  		"spider",
   443  		"squid",
   444  		"squirrel",
   445  		"starfish",
   446  		"stingray",
   447  		"swallow",
   448  		"swan",
   449  		"swordfish",
   450  
   451  		"tapir",
   452  		"tarantula",
   453  		"tiger",
   454  		"toad",
   455  		"tortoise",
   456  		"toucan",
   457  		"trout",
   458  		"turkey",
   459  		"turtle",
   460  
   461  		"urchin",
   462  
   463  		"viper",
   464  		"vulture",
   465  
   466  		"wallaby",
   467  		"walrus",
   468  		"wasp",
   469  		"weasel",
   470  		"whale",
   471  		"wolf",
   472  		"wolverine",
   473  		"wombat",
   474  		"woodchuck",
   475  		"worm",
   476  
   477  		"zebra",
   478  	}
   479  )
   480  
   481  // GetDeterministicName generates a name from the list of adjectives and
   482  // surnames from Docker's namesgenerator package, formatted as
   483  // "adjective_surname". For example 'focused_turing'.
   484  // The name is chosen deterministically based on the specified seed.
   485  func GetDeterministicName(seedValue []byte) string {
   486  	hash := sha256.New()
   487  	hash.Write(seedValue)
   488  	source := rand.NewSource(int64(binary.BigEndian.Uint64(hash.Sum(nil))))
   489  	r := rand.New(source)
   490  	return left[r.Intn(len(left))] + "_" + right[r.Intn(len(right))]
   491  }