ā Back
Show Markdown
Download Markdown
A high-performance .NET implementation of ULIDs (Universally Unique Lexicographically Sortable Identifiers) that fully complies with the official ULID specification.
ULIDs are identifiers designed to be universally unique and lexicographically sortable, making them ideal for distributed systems and time-ordered data. This library provides a robust and fully compliant .NET implementation of ULIDs.
Install the latest stable package via NuGet:
dotnet add package ByteAether.Ulid
using ByteAether.Ulid;
// Create a new ULID
Ulid ulid = Ulid.New();
Console.WriteLine(ulid);
// Parse a ULID from a string
Ulid parsedUlid = Ulid.Parse("01AN4Z07BY79KA1307SR9X4MV3");
Console.WriteLine(parsedUlid);
// Convert a ULID to a Guid
Guid guid = ulid.ToGuid();
Console.WriteLine(guid);
//Create a ULID from a Guid
Ulid ulidFromGuid = Ulid.New(guid);
Console.WriteLine(ulidFromGuid);
//Get time from ULID
DateTimeOffset time = ulid.Time;
Console.WriteLine(time);
//Check if ULID is valid
bool isValid = Ulid.IsValid("01AN4Z07BY79KA1307SR9X4MV3");
Console.WriteLine(isValid);
There is no required configuration.
<ItemGroup>
<PackageReference Include="ByteAether.Ulid" Version="[Latest Version]" />
</ItemGroup>
š This README is available in multiple languages:
š readme.maxpfeffer.de