A .NET library for generating Time-Sorted Unique Identifiers (TSID).
$ dotnet add package TSID.Creator.NETA .NET library for generating Time-Sorted Unique Identifiers (TSID). Compatible with .NET Standard 2.0/.NET Standard 2.1.
It brings together ideas from Twitter's Snowflake and ULID Spec.
In summary:
This library is a port of the Java code found here.
It is highly recommended to consult first the original Java code before using this library, in terms of usage and performance.
Create a TSID:
Tsid tsid = TsidCreator.GetTsid();
Create a TSID as long:
long number = TsidCreator.GetTsid().ToLong(); // 38352658567418872
Create a TSID as String:
string string = TsidCreator.GetTsid().ToString(); // 01226N0640J7Q
The TSID generator is thread-safe.