Skip to content

Configurable code name generator for .NET

License

Notifications You must be signed in to change notification settings

colinmxs/CodenameGenerator

Repository files navigation

CodenameGenerator Build status

Generates random codenames/usernames/whatever you want!

NuGet link

Examples

Default Configuration

var generator = new Generator();
var name = generator.Generate(); //ex: "rambunctious arthropod"

.Generate() will return a string consisting of an adjective and a noun with a space in between the two. The result will be lowercase.

var names = generator.GenerateMany(5);

//ex: "rambunctious arthropod"
//ex: "green man"
//ex: "laborious documentation"
//ex: "angelic lobotomy"
//ex: "abyssal hotdog"

Configurations

Specify the separator:

generator.Separator = "-"
var name = generator.Generate(); // ex: "rambunctious-arthropod"

Specify the types of words used to construct the code name:

generator.SetParts(WordBank.Adjectives, WordBank.FirstNames, WordBank.LastNames);
var name = generator.Generate(); //ex: "stupid david jones"

Specify the casing:

generator.Casing = Casing.UpperCase;
var name = generator.Generate(); // ex: "RAMBUNCTIOUS ARTHROPOD"

Specify a suffix

generator.EndsWith = "@email.com";
generator.Separator = ""; //no separator
var name = generator.Generate(); // ex: "[email protected]"

Available WordBanks

Available Casings

  • PascalCase (e.g. HelloWorld)
  • CamelCase (e.g. helloWorld)
  • LowerCase (e.g. helloworld)
  • UpperCase (e.g. HELLOWORLD)

About

Configurable code name generator for .NET

Topics

Resources

License

Stars

Watchers

Forks

Languages