libuuid
uuid-generate
uuid-generate/  random
uuid-generate/  time
6.3.90.900

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?

Generate new universally unique identifier using /dev/urandom, if available. If it is not available, use current time, local ethernet MAC address and random data from a pseudo-random generator.

Examples:
> (uuid-generate)

"72b97e29-3564-4d28-a447-5b3163e78574"

> (uuid-generate)

"77a46d57-c91d-4303-8b37-f7665509a647"

procedure

(uuid-generate/random)  string?

When /dev/urandom is available, same as uuid-generate, but fails back to a pseudo-random generator only.

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.

Examples:
> (uuid-generate/random)

"8848c2dd-0065-442d-b984-8e927e1158b5"

> (uuid-generate/random)

"bbefd483-40ae-4ecc-9036-e8832cf0102d"

procedure

(uuid-generate/time)  string?

Same as uuid-generate when the /dev/urandom is missing.

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.

Examples:
> (uuid-generate/time)

"3204fd92-c9ce-11e5-8410-080027c172e9"

> (uuid-generate/time)

"3205ab0c-c9ce-11e5-8410-080027c172e9"