Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

VSoft.Ulid

Universally Unique Lexicographically Sortable Identifier

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

VSoft.Ulid

A Delphi Implementation of ULID for Delphi XE2 or later.

  • 128-bit compatibility with UUID
  • Lexicographically sortable!
  • Canonically encoded as a 26 character string, as opposed to the 36 character UUID
  • Uses Crockford's base32 for better efficiency and readability (5 bits per character)
  • Case insensitive
  • No special characters (URL safe)
  • Monotonic sort order (correctly detects and handles the same millisecond)

Installation

DPM

Install VSoft.Ulid in the DPM IDE plugin, or

pascal
dpm install VSoft.Ulid .\yourproject.dproj

Manually

Clone the repository and add the VSoft.Ulid.pas file to your project, or add the repo\Source folder to your project's search path.

Usage

pascal
var
  ulid : TUlid;
  s : string;
begin
  ulid := TUlid.Create;
  s := ulid.ToString;
  
  .....
  ulid := TUlid.Parse('01J4H739Z46PZEFF5F6X5Q338Z');
  writeln(ulid.ToString);
end;