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) "d7bcfa18-3c4b-4221-ba35-1237031f52f7"
> (uuid-generate) "a56d8082-53d1-4a5c-86e5-e9fc4e686160"
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) "0ac93b32-616d-4aa1-9f21-e5eaebaa94e6"
> (uuid-generate/random) "b1a6b042-d203-404a-9e52-c64d4b796e65"
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) "ee7afc5a-3cc5-11f0-a2f6-f122119a4eff"
> (uuid-generate/time) "ee7b275c-3cc5-11f0-a2f6-f122119a4eff"