Re: sha1, sha2 functions into core?

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Marko Kreen <markokr(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: sha1, sha2 functions into core?
Date: 2011-08-12 16:37:58
Message-ID: 66B4204E-01E7-4CAD-8C0B-0C32EA1B1A9D@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Aug 12, 2011, at 5:02 AM, Marko Kreen wrote:

> My point was that giving such open-ended list of algorithms
> was bad idea, but there is no problem keeping old behaviour.
>
>> I don't see anything much wrong with sha1(bytea/text) -> bytea.
>> There's no law that says it has to work exactly like md5() does.
>
> The problem is that list of must-have algorithms is getting
> quite long: md5, sha1, sha224, sha256, sha384, sha512,
> + at least 4 from upcoming sha3.

+1

I think some sort of digest() function that takes a parameter naming the algorithm would be the way to go. That's not to say that the existing named functions could continue to exist -- md5() in core and sha1() in pg_crypto. But it sure seems to me like we ought to have just one function for digests (or 2, if we also have hexdigest()).

Best,

David

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-08-12 18:02:17 Re: Reworking the writing of WAL
Previous Message Jan Urbański 2011-08-12 16:29:02 Re: plpython crash