Skip to content

eXist-db library module for alternate randomly generated unique identifiers

License

Notifications You must be signed in to change notification settings

eXist-db/exist-alt-identifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Alternate Unique Identifier Library Module for eXist-db

ULID — Universally Unique Lexicographically Sortable Identifier

UUIDs are usually quite nice to use as random IDs. Most people including me would simply use a UUID v4 as a way to generate random IDs. But UUIDs v4 is just plain randomness. There is no way to tell if a uuid-a > uuid-b or the vice versa. That is when I discovered ULID. ULID stands for Universally unique Lexicographically sortable IDentifiers. ULID ensures that the IDs can be monotonically ordered and can be sorted even when generated within a millisecond. There are ²⁸⁰ possible ids within a millisecond.

xquery version "3.1";

import module namespace altid = "https://exist-db.org/xquery/altid";

altid:ulid()

From SecureRandom

This library function was inspired by the article at: Moving away from UUIDs by Neil Madden

Here is a sample XQuery

xquery version "3.1";

import module namespace altid = "https://exist-db.org/xquery/altid";

altid:secure-random()

It returned twRminDVuAMHoNTXwtHuV5wS2rs after one of the calls.

About

eXist-db library module for alternate randomly generated unique identifiers

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages