A simple and flexible random name generator for .NET, capable of creating names composed of an adjective and a noun from predefined categories. Supports customizable suffixes, separators, and output styles (lowercase, uppercase, title case). Ideal for generating usernames, project names, or other randomized identifiers.
$ dotnet add package UniqueNamer
UniqueNamer is a C# library for generating unique and memorable names (e.g., talented-toucan, naughty-watermelon). These names are ideal for naming temporary directories, user session IDs, gamer tags, project names, process names, or submitted jobs.
The library is inspired by aziele/unique-namer, originally developed by Andrzej Zielezinski. UniqueNamer expands on the concept, offering customizable name generation with a wide variety of thematic categories.
UniqueNamer is available as a NuGet package. You can install it using the NuGet Package Manager:
Install-Package UniqueNamer
Or via the .NET CLI:
dotnet add package UniqueNamer
The Generate method returns a unique and randomly generated name consisting of an adjective and a noun.
using UniqueNamer;
string name = UniqueNamer.Generate(new[] { Categories.Animals });
Console.WriteLine(name); // Example: 'blushy-cyclist'
The Generate method allows specifying categories to influence the type of generated names:
string name = UniqueNamer.Generate(new[] { Categories.Astronomy });
Console.WriteLine(name); // Example: 'crazy-supernova'
To select multiple categories:
string name = UniqueNamer.Generate(new[] { Categories.Physics, Categories.Biology });
Console.WriteLine(name); // Example: 'pink-bacteria'
The suffixLength parameter adds a random alphanumeric suffix to create a unique identifier:
string name = UniqueNamer.Generate(new[] { Categories.History }, suffixLength: 3);
Console.WriteLine(name); // Example: 'annoying-cleopatra-9a1'
Change the separator between name components:
string name = UniqueNamer.Generate(new[] { Categories.Sports }, separator: "_");
Console.WriteLine(name); // Example: 'savage_judo'
The Style enum lets you choose different text case formats:
string name = UniqueNamer.Generate(new[] { Categories.Food }, style: Style.UPPERCASE);
Console.WriteLine(name); // Example: 'DAMAGED-ELECTRON'
string nameTitle = UniqueNamer.Generate(new[] { Categories.Music }, separator: " ", style: Style.TitleCase);
Console.WriteLine(nameTitle); // Example: 'Lazy Unicorn'
UniqueNamer provides predefined categories to tailor generated names. Some available categories include:
AnimalsArtAstronomyBiologyChemistryComputerScienceEconomyFoodGeographyHistoryLiteratureMathMedicineMicrobiologyMolecularBiologyMusicPhysicsPlantsScientistsSportsTechnologyThis project is licensed under the MIT License.