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) "e10a5e55-cc6f-43e6-9734-75c0c085de6f"
> (uuid-generate) "eb3e1c9c-fadc-4807-8754-924f45237442"
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) "b3cf2027-9eb5-4206-b542-cdf1515403cf"
> (uuid-generate/random) "562c3ac0-f805-47f5-b3b5-8b3156c838ee"
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) "692b333a-8170-11f1-bafb-a7b2a47d4699"
> (uuid-generate/time) "692b70ca-8170-11f1-bafb-a7b2a47d4699"