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) "7f411a34-e8d9-40ff-a0fa-5d51a85fa6b5"
> (uuid-generate) "3d9572ad-163d-4185-9ed1-19b85896eb5e"
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) "5ad2890b-8b55-46f6-b6ab-031b21ea6900"
> (uuid-generate/random) "adb98c14-ae19-40c4-a6e6-cc6defed971e"
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) "831df33c-0efc-11f0-b1b6-cb16545690b2"
> (uuid-generate/time) "831e1e84-0efc-11f0-b1b6-cb16545690b2"