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) "f722fba0-e527-4159-848f-d0005009f426"
> (uuid-generate) "546b5ffe-7ea4-49b0-bbe1-7811309fa660"
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) "8ffb9047-a32b-4165-90e5-dbff4fbeb503"
> (uuid-generate/random) "1e02c583-e224-4cfc-adac-f1e6f41f44f0"
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) "9cbf9574-cd60-11f1-8b35-751a77143859"
> (uuid-generate/time) "9cbfcbfc-cd60-11f1-8b35-751a77143859"