logo

Readme-Racker

Say Goodbye to Manual README Writing.

← Back

Show Markdown

Download Markdown

Readme

ByteAether.Ulid

A high-performance .NET implementation of ULIDs (Universally Unique Lexicographically Sortable Identifiers) that fully complies with the official ULID specification.

Introduction

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.

Features

  • Universally Unique: Ensures global uniqueness across systems.
  • Sortable: Lexicographically ordered for time-based sorting.
  • Fast and Efficient: Optimized for high performance and low memory usage.
  • Specification-Compliant: Fully adheres to the ULID specification.
  • Interoperable: Includes conversion methods to and from GUIDs, and byte arrays.
  • Ahead-of-Time (AoT) Compilation Compatible: Fully compatible with AoT compilation for improved startup performance and smaller binary sizes.

Installation

Install the latest stable package via NuGet:

dotnet add package ByteAether.Ulid

Usage

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);

Configuration

There is no required configuration.

Dependencies

<ItemGroup>
    <PackageReference Include="ByteAether.Ulid" Version="[Latest Version]" />
</ItemGroup>

šŸŒ This README is available in multiple languages:
šŸ”— readme.maxpfeffer.de