Skip to content

ZIO-ULID#

A Scala (and ZIO) implementation of ULID specification

Sonatype Nexus (Releases) Sonatype Nexus (Snapshots)

What is ULID?#

ULID stands for "Universally Unique Lexicographically Sortable Identifier". Read more on Official specification or ZIO-ULID documentation

Installation#

libraryDependencies += "com.bilal-fazlani" %% "zio-ulid" % "<VERSION>"

Note

Only Scala 3 is supported at the moment. Scala 2.13 will be supported in the next release.

Why ZIO-ULID?#

While there are already a few implementations of ULID in Scala, I could not find one that fits natively in ZIO ecosystem. This library has the core logic from airframe-ulid implemented using FP and ZIO constructs.

Features#

  • Pure. No exceptions or any other side effects
  • Uses ZIO Clock for timestamps
  • Uses ZIO Random for randomness
  • Uses ZIO Ref for thread safety of state
  • Uses ZLayer for dependency injection
  • Returns ZIO[ULIDGen, Nothing, ULID]

Documentation Github


Inspirations#

Tools and references used#