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) "f4d466ac-9b0c-49a0-9cec-d628bb6f896e"
> (uuid-generate) "9d5848f3-7076-4617-b330-d85e61815934"
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) "276e9fee-b346-4c2d-8fc0-041be2f5b851"
> (uuid-generate/random) "b7af44d5-d3cf-4b5a-96f8-aee940086a6c"
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) "b0feda4c-ef5a-11f1-8f28-079794a4905a"
> (uuid-generate/time) "b0ff193a-ef5a-11f1-8f28-079794a4905a"