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) "99c95392-6ce7-4ab0-800d-50331f3d59bb"
> (uuid-generate) "6fd927ba-cacc-41cf-9b9d-2e4b81fdb745"
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) "855de201-f105-42b5-8733-3641e59e388f"
> (uuid-generate/random) "6e1b4886-eb3c-4383-900f-b09bc8f91566"
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) "1348f4fe-f2a3-11f0-b4cf-6d4749bd9487"
> (uuid-generate/time) "1349025a-f2a3-11f0-b4cf-6d4749bd9487"