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) "08de953c-627e-4e66-a6dd-3bd54d255c4c"
> (uuid-generate) "0fabfd50-8a36-4582-941e-69b22bbf5c1c"
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) "6aab1cc0-9889-4a34-ac48-ffbf6c3b7618"
> (uuid-generate/random) "3d9d260f-37e9-4409-bc67-218295a80255"
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) "951d56de-b6bf-11f0-8ee4-f92e38ea87da"
> (uuid-generate/time) "951d5d28-b6bf-11f0-8ee4-f92e38ea87da"