[erlang-questions] Generating readable unique IDs for use outside erlang
Kenji Rikitake
kenji.rikitake@REDACTED
Sat Feb 12 09:25:14 CET 2011
Solely depending on randomness does not necessarily guarantee the
uniqueness of the output; two calls from crypto:rand_bytes/1 may result
in the same value.
UUID has 128-bit value space, however, so the probability of accidental
duplication of two UUIDs may be small enough.
See RFC4122 for UUID URN Namespace. The Section 4.1.4 requires a
timestamp included in the UUID Version 1.
Kenji Rikitake
++> Jared Kofron <jared.nance@REDACTED> [2011-02-10 08:28:06 -0800]:
> I believe couch uses crypto's rand_bytes to accomplish this... something like
>
> to_hex(crypto:rand_bytes(16))
>
> generates a UUID for them.
More information about the erlang-questions
mailing list