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) "d6da0e10-d601-41e5-a7a6-1da931d44574"
> (uuid-generate) "cfb4a212-7728-428e-87bd-c1a076f4ad4a"
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) "023d8e55-314d-46eb-9a87-8b06d929a34a"
> (uuid-generate/random) "4afd00a4-7376-4ce0-a831-a6a465f6776e"
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) "b5712456-a60c-11f0-a29d-511616cfbc78"
> (uuid-generate/time) "b5714800-a60c-11f0-a29d-511616cfbc78"