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) "79dec5d4-f3ff-436b-b1ca-08175a5c3cbd"
> (uuid-generate) "660b9290-20bd-4564-9d4c-e34a27103197"
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) "4c30eb4d-09fb-48ae-a6cd-d322f3622147"
> (uuid-generate/random) "ef26352c-22f4-4877-8396-78ea0d813c1b"
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) "20be403a-85f6-11f1-bf92-396e77859d23"
> (uuid-generate/time) "20be499a-85f6-11f1-bf92-396e77859d23"