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) "405dde04-1453-491c-9f5f-a2bfc86e25de"
> (uuid-generate) "a0b29f87-55a9-4f9f-87a5-b96c2fbeb7d4"
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) "8c819cbd-86bb-4be3-bd8f-f5a8c74f70e1"
> (uuid-generate/random) "a014e741-43fe-4357-a571-097f36fc3e29"
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) "af859c9a-0f37-11f1-8e02-0da1f51e8a51"
> (uuid-generate/time) "af85a32a-0f37-11f1-8e02-0da1f51e8a51"