Random string and character-buffer generation for .NET developers, using System.Security.Cryptography.RandomNumberGenerator.
Use a .NET 10 console project. Install the package, then replace Program.cs with the example.
dotnet new console -f net10.0 -n CoreDemo
cd CoreDemo
dotnet add package DKNet.RandomCreator
using System;
using DKNet.RandomCreator;
var text = RandomCreators.NewString(32,
new StringCreatorOptions { MinNumbers = 4, MinSpecials = 2 });
Console.WriteLine(text.Length); // 32
Run with dotnet run.
The public static methods create a fresh internal StringCreator for each synchronous call. Selection and shuffling use the .NET RandomNumberGenerator APIs; there is no service registration, store or background worker. The project declares no direct package or project references; repository-wide build settings add analyzer tooling.
With the default length of 25 and zero quotas, output contains only letters. For nonnegative quotas, the digit and symbol counts are exact, and their sum must be less than the requested length. Invalid length or quota sum throws ArgumentException; detailed limits and both output forms are covered in the feature page.