ApricotFramework.IdGeneration
0.1.0
Prefix Reserved
dotnet add package ApricotFramework.IdGeneration --version 0.1.0
NuGet\Install-Package ApricotFramework.IdGeneration -Version 0.1.0
<PackageReference Include="ApricotFramework.IdGeneration" Version="0.1.0" />
<PackageVersion Include="ApricotFramework.IdGeneration" Version="0.1.0" />
<PackageReference Include="ApricotFramework.IdGeneration" />
paket add ApricotFramework.IdGeneration --version 0.1.0
#r "nuget: ApricotFramework.IdGeneration, 0.1.0"
#:package ApricotFramework.IdGeneration@0.1.0
#addin nuget:?package=ApricotFramework.IdGeneration&version=0.1.0
#tool nuget:?package=ApricotFramework.IdGeneration&version=0.1.0
ApricotFramework.IdGeneration
Identifier generation for .NET: self-describing prefixed strings such as usr-3f2a… for identifiers
you hand out, and time-ordered UUIDv7 Guid values for keys the database owns.
ApricotFramework.IdGeneration is the zero-dependency core.
Install
dotnet add package ApricotFramework.IdGeneration
dotnet add package ApricotFramework.IdGeneration.AspNetCore
Usage
using ApricotFramework.IdGeneration.AspNetCore.Extensions;
builder.Services.AddIdGeneration();
using ApricotFramework.IdGeneration;
// A prefixed string identifier: random, so it reveals nothing about when it was made.
string userId = idGenerator.Generate("usr"); // "usr-3f2a4c1e8b7d40f9a1c26e5d90b3f748"
// Read one back. Malformed input is a false, not an exception.
if (PrefixedId.TryParse(userId, out var parsed))
{
Console.WriteLine($"{parsed.Prefix} / {parsed.Uuid}");
}
// A key for a native uuid column: UUIDv7, so successive rows sort together in the index.
Guid key = uuidGenerator.Generate();
The prefixed string form, {prefix}-{32 lowercase hex characters}, is what consumers persist, so it
is a compatibility contract and will not change without a major version. The two generators differ
deliberately: string identifiers are UUIDv4 because they travel in URLs and payloads, while a UUIDv7
carries the millisecond it was created in — excellent for index locality, wrong for something you
hand to a client.
Full documentation: https://projectapricot.dev
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on ApricotFramework.IdGeneration:
| Package | Downloads |
|---|---|
|
ApricotFramework.IdGeneration.AspNetCore
ASP.NET Core integration for ApricotFramework.IdGeneration: one call registers the prefixed string id generator and the UUIDv7 Guid generator as singletons. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 174 | 8/14/2026 |