![]() |
VOOZH | about |
dotnet add package ByteAether.Ulid --version 1.3.7
NuGet\Install-Package ByteAether.Ulid -Version 1.3.7
<PackageReference Include="ByteAether.Ulid" Version="1.3.7" />
<PackageVersion Include="ByteAether.Ulid" Version="1.3.7" />Directory.Packages.props
<PackageReference Include="ByteAether.Ulid" />Project file
paket add ByteAether.Ulid --version 1.3.7
#r "nuget: ByteAether.Ulid, 1.3.7"
#:package ByteAether.Ulid@1.3.7
#addin nuget:?package=ByteAether.Ulid&version=1.3.7Install as a Cake Addin
#tool nuget:?package=ByteAether.Ulid&version=1.3.7Install as a Cake Tool
from ByteAether
👁 License
👁 NuGet Version
👁 NuGet Downloads
👁 GitHub Build Status
👁 GitHub Security
A high-performance, fully compliant .NET implementation of ULIDs (Universally Unique Lexicographically Sortable Identifiers), adhering to the official ULID specification.
For more detailed documentation, visit our GitHub repository.
👁 .NET AOT Ready
👁 .NET 10.0
👁 .NET 9.0
👁 .NET 8.0
👁 .NET 7.0
👁 .NET 6.0
👁 .NET 5.0
👁 .NET Standard 2.1
👁 .NET Standard 2.0
OverflowException by incrementing the timestamp component when the random part overflows, ensuring continuous unique ULID generation.Install the latest stable package via NuGet:
dotnet add package ByteAether.Ulid
To install a specific preview version, use the --version option:
dotnet add package ByteAether.Ulid --version <VERSION_NUMBER>
Here is a basic example of how to use the ULID implementation:
using System;
using ByteAether.Ulid;
// Create a new ULID
var ulid = Ulid.New();
// Convert to byte array and back
byte[] byteArray = ulid.ToByteArray();
var ulidFromByteArray = Ulid.New(byteArray);
// Convert to GUID and back
Guid guid = ulid.ToGuid();
var ulidFromGuid = Ulid.New(guid);
// Convert to string and back
string ulidString = ulid.ToString();
var ulidFromString = Ulid.Parse(ulidString);
Console.WriteLine($"ULID: {ulid}, GUID: {guid}, String: {ulidString}");
The Ulid implementation provides the following properties and methods:
Ulid.New(GenerationOptions? options = null)GenerationOptions parameter to customize the generation behavior.Ulid.New(DateTimeOffset dateTimeOffset, GenerationOptions? options = null)DateTimeOffset and default generation options. Accepts an optional GenerationOptions parameter to customize the generation behavior.Ulid.New(long timestamp, GenerationOptions? options = null)long) and default generation options. Accepts an optional GenerationOptions parameter to customize the generation behavior.Ulid.New(DateTimeOffset dateTimeOffset, ReadOnlySpan<byte> random)DateTimeOffset and a pre-existing random byte array.Ulid.New(long timestamp, ReadOnlySpan<byte> random)long) and a pre-existing random byte array.Ulid.New(ReadOnlySpan<byte> bytes)Ulid.New(Guid guid)Guid.Ulid.MinAt(DateTimeOffset datetime)DateTimeOffset.Ulid.MinAt(long timestamp)long).Ulid.MaxAt(DateTimeOffset datetime)DateTimeOffset.Ulid.MaxAt(long timestamp)long).Ulid.IsValid(string ulidString)Ulid.IsValid(ReadOnlySpan<char> ulidString)Ulid.IsValid(ReadOnlySpan<byte> ulidBytes)Ulid.Parse(ReadOnlySpan<char> chars, IFormatProvider? provider = null)IFormatProvider is ignored.Ulid.TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out Ulid result)true if successful.Ulid.Parse(string s, IFormatProvider? provider = null)IFormatProvider is ignored.Ulid.TryParse(string? s, IFormatProvider? provider, out Ulid result)true if successful.Ulid.MinValuedefault(Ulid) and Ulid.New(new byte[16]).Ulid.MaxValue0xFF).Ulid.EmptyUlid.MinValue.Ulid.DefaultGenerationOptionsUlid.New(...) call..TimeDateTimeOffset..TimeBytesReadOnlySpan<byte>..RandomReadOnlySpan<byte>..AsByteSpan()ReadOnlySpan<byte> representing the contents of the ULID..ToByteArray().ToGuid()Guid..ToString(string? format = null, IFormatProvider? formatProvider = null)Guid and string.==, !=, <, <=, >, >=.CompareTo, Equals, GetHashCode.IMinMaxValue<Ulid>, IEquatable<Ulid>, IIEqualityComparer<Ulid>, IComparable, IComparable<Ulid>, IComparisonOperators<Ulid, Ulid, bool>, IFormattable, IParsable<Ulid>, ISpanFormattable, ISpanParsable<Ulid>, IUtf8SpanFormattable, IUtf8SpanParsable<Ulid>.The GenerationOptions class provides detailed configuration for ULID generation, with the following key properties:
Monotonicity
Controls the behavior of ULID generation when multiple identifiers are created within the same millisecond. It determines whether ULIDs are strictly increasing or allow for random ordering within that millisecond. Available options include: NonMonotonic, MonotonicIncrement (default), MonotonicRandom1Byte, MonotonicRandom2Byte, MonotonicRandom3Byte, MonotonicRandom4Byte.
InitialRandomSource
An IRandomProvider for generating the random bytes of a ULID. The default CryptographicallySecureRandomProvider ensures robust, unpredictable ULIDs using a cryptographically secure generator.
IncrementRandomSource
An IRandomProvider that provides randomness for monotonic random increments. The default PseudoRandomProvider is a faster, non-cryptographically secure source optimized for this specific purpose.
This library comes with two default IRandomProvider implementations:
CryptographicallySecureRandomProviderSystem.Security.Cryptography.RandomNumberGenerator for high-quality, cryptographically secure random data.PseudoRandomProviderSystem.Random, ideal for performance-critical scenarios where cryptographic security is not required for random increments.Custom IRandomProvider implementations can also be created.
Supports seamless integration as a route or query parameter with built-in TypeConverter.
Includes a JsonConverter for easy serialization and deserialization.
Check out README in GitHub repository for examples to integrate with Entity Framework Core, Dapper, MessagePack, and Newtonsoft.Json.
Much of this implementation is either based on or inspired by existing works. This library is standing on the shoulders of giants.
This project is licensed under the MIT License. See the file for details.
| 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 is compatible. 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 is compatible. 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 is compatible. 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 was computed. 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 4 NuGet packages that depend on ByteAether.Ulid:
| Package | Downloads |
|---|---|
|
Pure.Primitives
Package Description |
|
|
Hexalith.Commons.UniqueIds
Unique identifier generation for .NET: ULID (sortable, distributed-safe), Base64URL GUID, and DateTime-based IDs with conversion utilities. |
|
|
TranMinhSang.AspNetCore.Extensions
Package Description |
|
|
Atlas1023
Package Description |
Showing the top 1 popular GitHub repositories that depend on ByteAether.Ulid:
| Repository | Stars |
|---|---|
|
minhsangdotcom/clean-architecture
Clean Architecture template for .NET 🚀
|
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 1.3.8-rc.0 | 48 | 6/12/2026 | |
| 1.3.7 | 3,822 | 5/11/2026 | |
| 1.3.7-rc.0 | 62 | 5/7/2026 | |
| 1.3.6 | 9,284 | 3/25/2026 | |
| 1.3.5 | 34,258 | 1/16/2026 | |
| 1.3.4 | 10,728 | 12/17/2025 | |
| 1.3.3 | 538 | 12/16/2025 | 1.3.3 is deprecated because it has critical bugs. |
| 1.3.2 | 10,141 | 11/14/2025 | |
| 1.3.1 | 4,961 | 8/13/2025 | |
| 1.3.0 | 1,838 | 7/31/2025 | |
| 1.2.0 | 2,247 | 6/25/2025 | |
| 1.1.1 | 238 | 6/24/2025 | |
| 1.1.0 | 2,765 | 4/16/2025 | |
| 1.0.0 | 12,032 | 1/21/2025 | |
| 0.2.2-alpha | 300 | 1/8/2025 | 0.2.2-alpha is deprecated because it is no longer maintained. |
| 0.2.1-alpha | 275 | 12/30/2024 | 0.2.1-alpha is deprecated because it is no longer maintained. |
| 0.2.0-alpha | 260 | 12/20/2024 | 0.2.0-alpha is deprecated because it is no longer maintained. |
| 0.1.2-alpha | 277 | 11/29/2024 | 0.1.2-alpha is deprecated because it is no longer maintained. |
| 0.1.1-alpha | 267 | 9/7/2024 | 0.1.1-alpha is deprecated because it is no longer maintained. |
| 0.1.0-alpha | 262 | 8/30/2024 | 0.1.0-alpha is deprecated because it is no longer maintained. |