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) "4f531c5c-0485-4f93-a666-985a6419145a"
> (uuid-generate) "c6131c03-4c7a-4115-84c0-f0619d53b617"
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) "2ebe74f1-7d08-4ef1-b578-cbe578d25b5c"
> (uuid-generate/random) "d8f090a9-598b-4117-8556-13e33db9a595"
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) "0b884870-9526-11f1-ac27-9930760bb7d0"
> (uuid-generate/time) "0b88ac5c-9526-11f1-ac27-9930760bb7d0"