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) "98a3d2b5-9cc6-46ca-a2fb-5e8300090f45"
> (uuid-generate) "93bdfd78-cc79-40a8-a1a8-21577aa7fc19"
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) "ca83cfa7-f3aa-4550-9242-2428140d1fa9"
> (uuid-generate/random) "0bdf1da9-06db-46b3-9c7e-b283e73546ee"
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) "0dec98b4-1074-11f1-9d20-59c2257112c0"
> (uuid-generate/time) "0deca6e2-1074-11f1-9d20-59c2257112c0"