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) "684bf9d0-dee8-4a59-8b0d-aedfcfa3ca30"
> (uuid-generate) "b060cf4e-756f-40c0-9299-5350f1961a5f"
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) "59eb16fe-cd21-4f6a-a336-dcd9080ef8d8"
> (uuid-generate/random) "9975e178-a788-427d-b270-b829f73f48be"
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) "f2a36b5c-c7b0-11f0-be85-3bd6b9238645"
> (uuid-generate/time) "f2a38362-c7b0-11f0-be85-3bd6b9238645"