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) "947bead9-0b42-417d-8196-07c0614733fc"
> (uuid-generate) "4eb02375-c51b-482d-a7c9-510ea040ecb2"
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) "91db6824-7d87-42a0-877e-273963faa79d"
> (uuid-generate/random) "5105a501-c64d-4f63-975a-30001052a294"
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) "1db39dac-de72-11f1-a2f4-810efbce9eaa"
> (uuid-generate/time) "1db3fc02-de72-11f1-a2f4-810efbce9eaa"