Re: Patch to eliminate duplicate b64 code from pgcrypto - Mailing list pgsql-hackers

From Marko Kreen
Subject Re: Patch to eliminate duplicate b64 code from pgcrypto
Date
Msg-id e51f66da0812171549j52c25fd1r6cec570cf5a49907@mail.gmail.com
Whole thread Raw
In response to Re: Patch to eliminate duplicate b64 code from pgcrypto  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
On 12/16/08, Bruce Momjian <bruce@momjian.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


pgsql-hackers by date:

Previous
From: "Pavel Stehule"
Date:
Subject: Re: Summary: changes needed in function defaults behavior
Next
From: Tom Lane
Date:
Subject: Re: Summary: changes needed in function defaults behavior