RandomCustomStrings 1.0.1
dotnet add package RandomCustomStrings --version 1.0.1
NuGet\Install-Package RandomCustomStrings -Version 1.0.1
<PackageReference Include="RandomCustomStrings" Version="1.0.1" />
<PackageVersion Include="RandomCustomStrings" Version="1.0.1" />
<PackageReference Include="RandomCustomStrings" />
paket add RandomCustomStrings --version 1.0.1
#r "nuget: RandomCustomStrings, 1.0.1"
#:package RandomCustomStrings@1.0.1
#addin nuget:?package=RandomCustomStrings&version=1.0.1
#tool nuget:?package=RandomCustomStrings&version=1.0.1
RandomCusomStrings
Ultralight customizable random string generator
Overview
The RandomCustomStrings class in the Promezio.RandomCustomStrings namespace provides a simple yet flexible way to generate random strings in C#. This can be highly useful in scenarios like generating random IDs, passwords, test data, and more. The class allows for extensive customization through the StringConfig class, enabling users to specify the length and character types of the generated strings.
Features
- Customizable String Length: Define the length of the generated string.
- Character Type Inclusion: Opt to include uppercase, lowercase, numbers, special characters, and/or custom characters in the string.
- Custom Character Support: Add any set of custom characters to the string generation pool.
Usage
Add Namespace: Include the namespace in your code.
using Promezio.RandomCustomStrings;Create Configuration: Instantiate a
StringConfigobject with your desired settings.StringConfig config = new StringConfig( lenght: 10, containUppercase: true, containLowercase: true, containNumbers: true, containSpecialChars: true );Generate String: Use the
Generatemethod to create a random string.string randomString = RandomCustomStrings.Generate(config);
Example
StringConfig config = new StringConfig(15, containUppercase: true, containNumbers: true);
string myRandomString = RandomCustomStrings.Generate(config);
Console.WriteLine(myRandomString);
Included seeds
uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
lowercase = "abcdefghijklmnopqrstuvwxyz";
numbers = "0123456789";
specialChars = ",.;:-_*()%$&?!=/";
Use custom characters
StringConfig config = new StringConfig(10,
customChars: "@�\|",
containCustomChars: true);
string randomString = RandomCustomStrings.Generate(config);
Contribution
Feel free to fork this project, submit pull requests, or report bugs and feature requests on the issue tracker.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Powered by Promezio
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.