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) "1c12c674-7a61-45ef-a8b5-9fc6a78f5180"
> (uuid-generate) "24d53677-1fff-452d-b3a1-6a4e2e9279bc"
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) "c7d85692-afa3-4c25-9b43-e2a35bead9dc"
> (uuid-generate/random) "eeb03f7c-e0c5-42fd-ba91-a10c26ab3967"
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) "e3c3b622-40a6-11f1-b0dc-a78edbc52332"
> (uuid-generate/time) "e3c3bcd0-40a6-11f1-b0dc-a78edbc52332"