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) "bd60d5ef-d171-44c1-b137-94d84f8ed6a9"
> (uuid-generate) "0eee90c3-5a45-412f-9362-9679a6f4e046"
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) "a02918ae-02af-43bf-b441-0ccb322d08e5"
> (uuid-generate/random) "c37c1492-399c-4d3a-b3b9-685d924c1915"
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) "d163e98c-f630-11ef-83a5-2ba583640f6f"
> (uuid-generate/time) "d163fbe8-f630-11ef-83a5-2ba583640f6f"