ulid:   universally unique lexicographically sortable identifiers
ulid/  c
ulid-bytes/  c
make-ulid-factory
ulid
ulid-time
ulid-randomness
ulid->bytes
bytes->ulid
8.12

ulid: universally unique lexicographically sortable identifiers🔗ℹ

Bogdan Popa <bogdan@defn.io>

 (require ulid) package: ulid

This package provides an implementation of ULIDs, which are a lexicographically-sortable alternative to UUIDs.

value

ulid/c : string?

Represents a ULID string.

Represents the binary representation of a ULID.

procedure

(make-ulid-factory)  (-> (and/c ulid/c immutable?))

Returns a function that can be used to generate ULIDs. Any ULIDs generated within the same millisecond by the resulting function will increase monotonically.

The generator functions are thread-safe.

procedure

(ulid)  (-> (and/c ulid/c immutable?))

Generates an ULID.

procedure

(ulid-time s)  exact-nonnegative-integer?

  s : ulid/c
Returns the time component of the ULID s.

Returns the random component of the ULID s.

procedure

(ulid->bytes u)  ulid-bytes/c

  u : ulid/c
Returns the binary representation of the ULID u.

procedure

(bytes->ulid bs)  ulid/c

  bs : ulid-bytes/c
Converts bs to a ULID. Raises an error if the result is not a valid ULID.