Re: pgcrypto: implement gen_random_uuid

Поиск
Список
Период
Сортировка
От Wim Lewis
Тема Re: pgcrypto: implement gen_random_uuid
Дата
Msg-id 20140113023524.3BF8B15479E5@machamp.omnigroup.com
обсуждение исходный текст
Ответ на [PATCH] pgcrypto: implement gen_random_uuid  (Oskari Saarenmaa <os@ohmu.fi>)
Ответы Re: pgcrypto: implement gen_random_uuid  (Oskari Saarenmaa <os@ohmu.fi>)
Список 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.)




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: Compiling extensions on Windows
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: Compiling extensions on Windows