Skip site navigation (1) Skip section navigation (2)

[RFC] new digest datatypes, or generic fixed-len hex types?

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: [RFC] new digest datatypes, or generic fixed-len hex types?
Date: 2009-07-27 11:50:30
Message-ID: 20090727115030.GA6459@alvh.no-ip.org (view raw or flat)
Thread:
Lists: pgsql-hackers
Hi,

We've developed some code to implement fixed-length datatypes for well
known digest function output (MD5, SHA1 and the various SHA2 types).
These types have minimal overhead and are quite complete, including
btree and hash opclasses.

We're wondering about proposing them for inclusion in pgcrypto.  I asked
Marko Kreen but he is not sure about it; according to him it would be
better to have general fixed-length hex types.  (I guess it would be
possible to implement the digest types as domains over those.)

So basically we have sha1, sha-256, sha-512 etc on one hand, and hex8,
hex16, hex32 on the other hand.  In both cases there is a single body of
code that is compiled with a macro definition that provides the data
length for every separate case.  (Actually in the digest code we
refactored the common routines so that each type has a light wrapper
calling a function that works on any length; this could also be done to
the fixed-len hex code as well -- that code is pretty grotty at the
moment.)

Of these two choices, which one is likely to have better acceptance
around here?

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Responses

pgsql-hackers by date

Next:From: Boszormenyi ZoltanDate: 2009-07-27 12:00:01
Subject: Re: SELECT ... FOR UPDATE [WAIT integer | NOWAIT] for 8.5
Previous:From: Dimitri FontaineDate: 2009-07-27 10:40:55
Subject: Re: query - change in gistentryinit between 8.1 and 8.2

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group