Skip to content
m4bwav edited this page Sep 28, 2026 · 1 revision

FAQ

Every generator gives me the same names

On .NET Framework with a version before 2.1.0, new PersonNameGenerator() created its own new Random(), seeded from the clock, so generators created in the same tick produced the same sequence (issue #7). Upgrade to 2.1.0 or later: default generators now share Random.Shared on .NET 6 and later and take distinct seeds from a process-wide source everywhere else. On any version, creating one generator and reusing it also avoids the problem.

The names look odd. Is the data wrong?

The lists have their frequencies stripped, so every one of the 88,799 last names is as likely as Smith, and most surnames on a census list are rare. Vanvolkinburg and Niceswander are real Census entries, just uncommon ones. If you want common-looking names, the lists are in Census order with the most frequent first, so pick from PersonNameGenerator.LastNames.Take(500) with your own Random.

Why do male first names repeat more than female ones?

GenerateRandomFirstName picks male or female with equal probability and then a name from that list. There are 1,219 male and 4,275 female first names, so any one male name is about 3.5 times likelier than any one female name. Use GenerateRandomMaleFirstName and GenerateRandomFemaleFirstName when the odds within a list matter.

Are these real people?

No. The lists are names, not people. The Census published how often each first name and each surname occurred, without linking them, and any full name the library produces is a random pairing. A match with a real person is chance.

Can I get names from other countries?

No. The person lists are the 1990 US Census (English spelling, ASCII, Title case) and the place list is the Census 2000 places file for the United States and Puerto Rico. The star names are international by nature.

Can I add my own names or weight the lists?

Not through the API; the static lists are read-only. You can filter or combine them and pick with your own Random (see Recipes), or implement IPersonNameGenerator yourself over a different data set.

Is the randomness cryptographically secure?

No. Everything comes from System.Random. The names are for test data, fixtures, games and demos, never for passwords, tokens or anything an attacker must not predict.

Does it need the network or files on disk?

No. The seven lists are embedded in the assembly and parsed once per process, on first use. There is nothing to configure.

How big is it?

The download is 943 KB and the assembly about 1 MB, of which 977 KB is the lists; the 88,799 last names alone are 695 KB. After first use the lists live in memory as arrays of strings.

Some characters show as question marks

52 place names carry accents (Mayagüez zona urbana), and star names use diacritics and superscript digits (Boötis, Delta² Gruis). The strings are right; the console is not showing them. Set Console.OutputEncoding = System.Text.Encoding.UTF8; before writing, or write to a UTF-8 file.

Can I share a generator between threads?

The lists can be read from any thread. On .NET 6 and later a generator from the default constructor uses Random.Shared and can be shared. A generator built on a Random you supplied, an extension method call, or a default generator on .NET Framework uses a plain Random, which is not thread-safe: use one per thread.

Do seeded names change between versions?

Person names have been the same for a given seed since 1.2.2. Place names changed in 2.1.0 and 2.3.0 because the list changed. Star names exist since 2.2.0 and have not changed. Every answer of 2.2.0 is recorded and replayed by the repository's tests, so any change is deliberate and in the changelog. See Reproducible names.

Does it work with trimming and Native AOT?

The net10.0 build is marked trimmable and AOT compatible. The netstandard2.0 build uses no reflection beyond reading its own embedded resources.

Does it work in Unity?

Yes, with the netstandard2.0 build. See Getting started.

Why return IEnumerable when the list is already built?

The return type dates from 1.x and stays for compatibility. The object is a List<string>, so ToList() copies it, Count() is cheap, and enumerating twice gives the same names.

Where do I report a problem?

Bugs and questions go to the issues. Security concerns follow SECURITY.md in the repository.

Clone this wiki locally