From: | Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> |
---|---|
To: | Michael Paquier <michael(at)paquier(dot)xyz> |
Cc: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: SHA-2 functions |
Date: | 2018-02-20 22:05:37 |
Message-ID: | 3624b4e1-78ef-1d0d-3abc-2f5510fe2112@2ndquadrant.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2018-02-20 22:09:48 | Re: SHA-2 functions |
Previous Message | Tomas Vondra | 2018-02-20 21:25:14 | Re: ALTER TABLE ADD COLUMN fast default |