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) "5ad022a2-82fc-4178-9124-cd210d5b3671"
> (uuid-generate) "7ce54a8d-3502-425c-b2fc-578fbda9d34d"
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) "b7ca3a3b-55ca-4267-a986-463800397a1a"
> (uuid-generate/random) "3084671c-ab7e-4b10-a689-e734830717d1"
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) "92a04c68-2dca-11f1-ac08-3510ac2c8956"
> (uuid-generate/time) "92a053c0-2dca-11f1-ac08-3510ac2c8956"