libuuid
Jan Dvorak <mordae@anilinux.org>
Interface to the libuuid library usable to generate high-quality UUIDs.
(require libuuid) | package: libuuid |
procedure
(uuid-generate) → string?
> (uuid-generate) "e6e17a59-bb37-4398-a230-e83dbc3c5ccd"
> (uuid-generate) "a103326c-d363-437b-b1b0-12414626bf71"
procedure
Can be used to prevent any chance of host’s MAC address leaking, at the cost of slightly higher chance of generating non-unique identifiers if the worst-case situation arises on multiple hosts.
> (uuid-generate/random) "91b3b22f-217b-4afa-86ac-a2f1c6d613d3"
> (uuid-generate/random) "2597e3de-7867-4147-b0e0-2b7519aba384"
procedure
Could potentially produce non-uniqueue identifiers if used concurrently so if you do not absolutely need sequential identifiers, stick with the generic (and safe) uuid-generate function above.
> (uuid-generate/time) "f3508778-40d4-11f0-87d7-074b12218d62"
> (uuid-generate/time) "f350ab18-40d4-11f0-87d7-074b12218d62"