Re: SHA-2 functions

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: SHA-2 functions
Дата
Msg-id 3624b4e1-78ef-1d0d-3abc-2f5510fe2112@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: SHA-2 functions  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: SHA-2 functions
Список pgsql-hackers
On 2/19/18 21:07, Michael Paquier wrote:
> +       <entry><literal>sha224('abc')</literal></entry>
> +       <entry><literal>\x23097d223405d8228642a477bda2​55b32aadbce4bda0b3f7e36c9da7</literal></entry>
> Some bytea characters from the hash are not able to show up correctly?
> This does not result in spaces.

U+200B is a zero-width space, used here to hint for possible line breaks.

> +   Note that for historic reasons, the function <function>md5</function>
> +   returns a hex-encoded value of type <type>text</type> whereas the SHA-2
> +   functions return type <type>bytea</type>.  Use the functions
> +   <function>encode</function> and <function>decode</function> to convert
> +   between the two.
> Adding an example would be nice.

OK

> varlena.c is already large and messy.  I would suggest to split into a
> new file all the user-facing cryptographic functions, including md5 and
> hex functions, say in src/backend/utils/adt/crypt.c.

I had originally started a new file called hash.c, but I figured that
would be quite confusing.  I can use crypt.c or a similar name.
Although crypt.c sounds a lot like crypt().

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: ALTER TABLE ADD COLUMN fast default
Следующее
От: Tom Lane
Дата:
Сообщение: Re: SHA-2 functions