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) "989de091-c8b9-434f-8773-c994eb882c34"
> (uuid-generate) "6b06183c-4eec-4808-b833-55e0019c3218"
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) "e6c626ea-d34b-4c73-ae58-94d60ea0842f"
> (uuid-generate/random) "85ef5ed7-8080-4108-9e14-b348b09f3990"
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) "cbbd2c88-3977-11f1-9e0d-5d0e3048cbc6"
> (uuid-generate/time) "cbbd5096-3977-11f1-9e0d-5d0e3048cbc6"