Re: Patch to eliminate duplicate b64 code from pgcrypto

From: "Marko Kreen" <markokr(at)gmail(dot)com>
To: "Bruce Momjian" <bruce(at)momjian(dot)us>
Cc: "Marc Munro" <marc(at)bloodnok(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Patch to eliminate duplicate b64 code from pgcrypto
Date: 2008-12-17 23:49:47
Message-ID: e51f66da0812171549j52c25fd1r6cec570cf5a49907@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12/16/08, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> Would someone who understand pgcrypto please review this?

> Marc Munro wrote:
> > I am attaching a patch to eliminate duplicate b64_encode and decode
> > functions from pgcrypto, and to expose those functions for use by
> > add-ins (I want to use them in Veil).

Although your patch achieves the goal, it may make more sense to export
pg_find_encoding() and struct pg_encoding, thus making all encoding
algorithms available externally.

> > The patch was made against CVS head today. It compiles and tests
> > successfully. Though I was unable to run pgrypto regression tests, I
> > did give the b64 encoding a sanity check.
> >
> > I also added a b64_char() function that is now used from pgcrypto. This
> > allowed me to remove the duplicate _base64 character array.

I think this can be avoided by using plain b64_encode() for those 3 bytes.
That step is really not speed critical.

--
marko

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-12-17 23:56:24 Re: Summary: changes needed in function defaults behavior
Previous Message Pavel Stehule 2008-12-17 23:33:02 Re: Summary: changes needed in function defaults behavior