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) "03be31d6-1a04-4869-8d77-a5de2258746f"
> (uuid-generate) "c13a8350-3d4b-44f9-ad67-f957457a2d8d"
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) "9986b96e-7ca8-43ef-b875-137215fc8a3b"
> (uuid-generate/random) "5968c07d-bc0f-42a2-a897-3040a2b9ca60"
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) "7c454614-bb9f-11f0-b9e5-558125cc0d17"
> (uuid-generate/time) "7c454cea-bb9f-11f0-b9e5-558125cc0d17"