![]() |
VOOZH | about |
dotnet add package Funcular.IdGenerators --version 3.0.2
NuGet\Install-Package Funcular.IdGenerators -Version 3.0.2
<PackageReference Include="Funcular.IdGenerators" Version="3.0.2" />
<PackageVersion Include="Funcular.IdGenerators" Version="3.0.2" />Directory.Packages.props
<PackageReference Include="Funcular.IdGenerators" />Project file
paket add Funcular.IdGenerators --version 3.0.2
#r "nuget: Funcular.IdGenerators, 3.0.2"
#:package Funcular.IdGenerators@3.0.2
#addin nuget:?package=Funcular.IdGenerators&version=3.0.2Install as a Cake Addin
#tool nuget:?package=Funcular.IdGenerators&version=3.0.2Install as a Cake Tool
A cross-process thread-safe C# utility to create ordered (but non-sequential), human speakable, case-insensitive, partially random (non-guessable) identifiers in Base36. Identifiers are composed of (in this order), a timestamp component, a server hash component, an optional number of reserved characters, and a random component. Note: Source for the ExtensionMethods NuGet package dependency is available at Funcular.ExtensionMethods.
{7331d71b-d1f1-443b-97f6-f24eeb207828}040VKZ3C60SL3B1Z2RW5 or 040VK-Z3C60-SL3B1-Z2RW5Create a generator instance by passing the lengths of the various components, plus any desired delimiter character and layout (optional), to the constructor. To generate Ids, simply call NewId() for a plain identifier or NewId(true) for a delimited one. The class is thread-safe, so your DI container can share a single instance across the entire app domain. See the Wiki for a complete multithreaded stress and performance test.
var generator = new Base36IdGenerator(
numTimestampCharacters: 12,
numServerCharacters: 6,
numRandomCharacters: 7,
reservedValue: "",
delimiter: "-",
delimiterPositions: new[] {20, 15, 10, 5})
Console.WriteLine(generator.NewId());
// "00E4WG2E7NMXEMFY919O2PIHS"
Console.WriteLine(generator.NewId(delimited: true));
// "00E4W-G2GTO-0IEMF-Y911Q-KJI8E"
...your wish list here...
Ids are composed of some combination of a timestamp, a server hash, a reserved character group (optional), and a random component.
{7331d71b-d1f1-443b-97f6-f24eeb207828}040VZ3C6SL3BZ2RW or 040V-Z3C6-SL3B-Z2RW
040VZ-C6SL0-1003B-Z00R2
040VZ-C6SL0-1003B-Z00R2-01KR4
[TestClass]
public class IdGenerationTests
{
private Base36IdGenerator _idGenerator;
[TestInitialize]
public void Setup()
{
this._idGenerator = new Base36IdGenerator(
numTimestampCharacters: 11,
numServerCharacters: 5,
numRandomCharacters: 4,
reservedValue: "",
delimiter: "-",
// give the positions in reverse order if you
// don't want to have to account for modifying
// the loop internally. To do the same in ascending
// order, you would need to pass 5, 11, 17 instead.
delimiterPositions: new[] {15, 10, 5});
}
[TestMethod]
public void TestIdsAreAscending()
{
string id1 = this._idGenerator.NewId();
string id2 = this._idGenerator.NewId();
Assert.IsTrue(String.Compare(id2, id1, StringComparison.OrdinalIgnoreCase) > 0);
}
[TestMethod]
public void TestIdLengthsAreAsExpected()
{
// These are the segment lengths passed to the constructor:
int expectedLength = 11 + 5 + 0 + 4;
string id = this._idGenerator.NewId();
Assert.AreEqual(id.Length, expectedLength);
// Should include 3 delimiter dashes when called with (true):
id = this._idGenerator.NewId(true);
Assert.AreEqual(id.Length, expectedLength + 3);
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 is compatible. net5.0-windows net5.0-windows was computed. net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 is compatible. |
| .NET Framework | net461 net461 is compatible. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 3 NuGet packages that depend on Funcular.IdGenerators:
| Package | Downloads |
|---|---|
|
Funcular.DataProviders
•Provides easy bulk insert, delete and update methods without round trips to the database (New in 0.8.5) •Automatically scans assemblies in your AppDomain for configurable entities •No EDMXs •Sets up a SQL Server context with no configuration but a connection string •Does not require you to manually add entity types to your DbSet •By default, picks up any classes derived from EntityTypeConfiguration •One line of code—a predicate—specifies which Types from your assembly are entities Currently supports SQL Server; eventually will handle MongoDB and other underlying stores. |
|
|
GRUPESABDECV.Software.Identity
Algoritmos para generación de identificadores de entidades o procesos |
|
|
LingbugUtils
Description |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.2 | 380 | 8/30/2025 |
| 3.0.1 | 322 | 8/30/2025 |
| 2.6.0 | 14,982 | 3/7/2017 |
| 2.5.0 | 18,955 | 4/13/2016 |
| 2.0.0 | 2,537 | 3/18/2016 |
| 1.1.0 | 7,210 | 1/26/2016 |
| 1.0.0 | 2,017 | 10/15/2015 |
| 0.9.1 | 2,870 | 8/1/2015 |
| 0.5.0.2 | 3,504 | 7/13/2015 |
| 0.5.0.1 | 1,662 | 7/13/2015 |
| 0.5.0 | 1,954 | 7/13/2015 |
| 0.0.9 | 1,651 | 7/7/2015 |
| 0.0.8 | 1,644 | 6/30/2015 |
| 0.0.7.3 | 1,602 | 6/30/2015 |
| 0.0.7.2 | 1,657 | 6/30/2015 |
| 0.0.7.1 | 1,595 | 6/30/2015 |
- Added support for NetStandard, NET5, NET6, NET8