Universally Unique Lexicographically Sortable Identifier
See details: https://github.com/ulid/spec
(asdf:load-system :ulid)
(format t "~a~&" (ulid:generate-now))
represents unsigned 128-bits integer.
represents 26-characters string encoded with Crockford's Base32.
holds unsigned 128-bit integer that represents unique lexicographically sortable identifier. The first 48 bits of 128 bits are a UNIX timestamp in milliseconds for lexicographically sorting. The remaining 80 bits are randomness that ensure the identifier is unique.
returns timestamp part of ulid
.
returns randomness part of ulid
.
are signaled when you try to decode invalid Base32 encoded string.
converts ulid
into unsigned 128-bits integer.
encodes unsigned 128-bits integer to 26-characters Crockford's Base32.
encodes ulid
to 26-characters Crockford's Base32.
decodes 26-character Crockford's Base32 to unsigned 128-bit integer.
converts unsigned 128-bits integer to ulid
.
decodes 26-characters Crockford's Base32 string to ulid
.
generates ulid
from current timestamp and randomness.
First, you should clone this repository to ~/common-lisp/ulid
.
Try ULID generation on your shell:
$ make build
$ ./ulid
You can copy ./ulid
binary anywhere you like.
Licence: BSD