Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Create a K-Sortable Unique IDentifier (KSUID), inspired by NoSQL JSON document databases
ResourceFunction["CreateSortableUniqueID"][] creates a hexadecimal unique partially sortable ID. | |
ResourceFunction["CreateSortableUniqueID"][n] creates a list of n hexadecimal unique partially sortable IDs. |
Get one unique sortable ID:
In[1]:= | ![]() |
Out[1]= | ![]() |
Get a list of unique sortable IDs:
In[2]:= | ![]() |
Out[2]= | ![]() |
Note that the beginning of the IDs are close to one another because they are based on a Unix timestamp. The second part is a random value:
In[3]:= | ![]() |
Out[3]= | ![]() |
We can check when these mysterious IDs were created:
In[4]:= | ![]() |
Get the first eight digits, convert to decimal and get a DateObject from each Unix timestamp:
In[5]:= | ![]() |
Out[5]= | ![]() |
By breaking the KSUID apart into two hexadecimal values, we can plot multiple sortable IDs in a graph, and view the random and repetitive parts:
In[6]:= | ![]() |
Out[6]= | ![]() |
We can view a set of IDs as an image:
In[7]:= | ![]() |
Out[7]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License