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) "87de1456-1022-48bb-8090-e7b7e530b4f0"
> (uuid-generate) "653992da-3009-4bd9-a2a2-af4b11a08dd4"
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) "268ed4cd-7675-464e-93f9-a6cc0e4f50f6"
> (uuid-generate/random) "364c1dd0-b500-41c4-bcb5-0eec8dc0f103"
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) "eb569f90-8d0f-11ea-84e5-c16db3d41a5f"
> (uuid-generate/time) "eb56abe8-8d0f-11ea-84e5-c16db3d41a5f"