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) "3fccb2bc-6f71-4335-9bff-78932776229e"
> (uuid-generate) "b35fb948-fb07-4ea9-a722-162f0fd6c52e"
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) "0e49eef4-34d1-443b-82e0-1e0c8e55cb0d"
> (uuid-generate/random) "0a21e611-5117-48c8-a8ce-6d56aa360c19"
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) "1f40d394-5f1e-11f0-a602-2bec95abfc4d"
> (uuid-generate/time) "1f41da78-5f1e-11f0-a602-2bec95abfc4d"