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) "9f5aa0c7-26f5-4aa7-86bc-ba001a064990"
> (uuid-generate) "3026e9d9-e15a-473e-9e48-57a52c8a5ece"
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) "66336f22-fb58-4400-a137-a8ecc240e303"
> (uuid-generate/random) "9ecdfeb2-1f01-4a66-85d4-48efbc34a468"
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) "54e57d8e-8038-11f0-b068-493ba8dc208a"
> (uuid-generate/time) "54e5b4c0-8038-11f0-b068-493ba8dc208a"