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) "859a01f9-3725-4fde-aeaa-1becf0d606d4"
> (uuid-generate) "56c99057-5e5a-48d1-b841-cfa8646e5c41"
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) "f98056eb-6148-4441-8ed4-6ec9839b1fb9"
> (uuid-generate/random) "636be915-17fe-4535-9529-a34ff3328eee"
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) "fcff6642-5972-11f1-aa98-4b7363f57f75"
> (uuid-generate/time) "fcff73bc-5972-11f1-aa98-4b7363f57f75"