Re: pgcrypto: implement gen_random_uuid

From: Wim Lewis <wiml(at)omnigroup(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pgcrypto: implement gen_random_uuid
Date: 2014-01-13 02:35:15
Message-ID: 20140113023524.3BF8B15479E5@machamp.omnigroup.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

One comment, this:

> /* get 128 random bits */
> int err = px_get_random_bytes(buf, 16);

might be better to use px_get_pseudo_random_bytes(). UUIDs don't
need to be unguessable or have perfect entropy; they just need to
be collision-resistant. RFC4122 mentions this I think, and if you
look at the ossp-uuid function that this is replacing, it also uses
its internal PRNG for v4 UUIDs rather than strong high-entropy
randomness.

(The downside of requesting strong randomness when you don't need
it is that it can potentially cause the server to block while the
system gathers entropy.)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2014-01-13 02:56:13 Re: Compiling extensions on Windows
Previous Message Craig Ringer 2014-01-13 01:32:13 Re: Compiling extensions on Windows