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) "2a01a8d2-b9ee-40ea-9c54-32aa5e5e8ab2"
> (uuid-generate) "aab4d680-f689-4159-beb4-2c41d2a46729"
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) "4547b667-141a-4012-8e3a-860a3e0ee006"
> (uuid-generate/random) "97b537f5-022f-4d15-aaf6-129b1ede3a43"
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) "9e9af182-cea5-11f0-b914-15b9726aa6cf"
> (uuid-generate/time) "9e9af88a-cea5-11f0-b914-15b9726aa6cf"