EPS.Extensions.Unique 8.0.1

dotnet add package EPS.Extensions.Unique --version 8.0.1                
NuGet\Install-Package EPS.Extensions.Unique -Version 8.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EPS.Extensions.Unique" Version="8.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EPS.Extensions.Unique --version 8.0.1                
#r "nuget: EPS.Extensions.Unique, 8.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install EPS.Extensions.Unique as a Cake Addin
#addin nuget:?package=EPS.Extensions.Unique&version=8.0.1

// Install EPS.Extensions.Unique as a Cake Tool
#tool nuget:?package=EPS.Extensions.Unique&version=8.0.1                

EPS.Extensions.Unique

What initially started as a way to replace System.Web.Security.Membership.GeneratePassword from legacy ASP.NET has turned into a unique ID generator that's shorter than using GUIDs. You can use it to build identifiers similar to YouTube or Firestore IDs, if needed. We ran a test building identifiers with 7 alphanumeric characters (and no punctuation characters) and managed to get 10 million unique identifiers out of it. We didn't try a larger number, but, assuming our math isn't wrong (🤷), it seems you should be able to get at least 62^7 or 3.522 trillion unique identifiers out of it.

Sample output:

[Fact]
public void TestUnique()
{
    var hs = new HashSet<string>();
    for (int i = 0; i < 100; i++)
    {
        var u = Unique.Unique.Generate(8, 0);
        hs.Add(u);
        output.WriteLine(u);
    }
}
Xq8Lnhkq
udPe7BhM
mvsKFYjy
IiQrpozS
hcbskLr4
VmsINq1M
O2rMu84n
f6sHbtk1
XbDcLacW
idhJKidB
xAgditbO
TuQCrY3U
...
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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.

Version Downloads Last updated
8.0.1 16 7/24/2024
8.0.0 164 6/18/2024
6.0.1 398 12/13/2022
5.0.0 365 5/13/2021
1.1.0 371 5/7/2021
1.0.0 493 6/27/2020

Add two new methods to give random uppercase and lowercase characters.