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) "e2dba6fd-0871-4528-a96c-ee31ecce3a6a"
> (uuid-generate) "158d4556-79d1-4c61-a89a-98381dd5da40"
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) "aa09126d-14c7-420f-b3c5-df4b18ea2b6a"
> (uuid-generate/random) "bc937f5f-5428-4be3-af90-bc0891b771eb"
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) "4ba77f3c-b83c-11f1-94f5-f3151be6e0bd"
> (uuid-generate/time) "4ba79346-b83c-11f1-94f5-f3151be6e0bd"