pgsql/contrib/pgcrypto Makefile README.pgcrypt ...

From: Bruce Momjian - CVS <momjian(at)hub(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql/contrib/pgcrypto Makefile README.pgcrypt ...
Date: 2001-01-24 03:46:16
Message-ID: 200101240346.f0O3kGf05655@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

CVSROOT: /home/projects/pgsql/cvsroot
Module name: pgsql
Changes by: momjian(at)hub(dot)org 01/01/23 22:46:16

Modified files:
contrib/pgcrypto: Makefile README.pgcrypto pgcrypto.c
pgcrypto.sql.in
Added files:
contrib/pgcrypto: encode.c encode.h

Log message:
I would like to do a interface change in pgcrypto. (Good
timing, I know :)) At the moment the digest() function returns
hexadecimal coded hash, but I want it to return pure binary. I
have also included functions encode() and decode() which support
'base64' and 'hex' encodings, so if anyone needs digest() in hex
he can do encode(digest(...), 'hex').

Main reason for it is "to do one thing and do it well" :)

Another reason is if someone needs really lot of digesting, in
the end he wants to store the binary not the hexadecimal result.
It is really silly to convert it to hex then back to binary
again. As I said if someone needs hex he can get it.

Well, and the real reason that I am doing encrypt()/decrypt()
functions and _they_ return binary. For testing I like to see
it in hex occasionally, but it is really wrong to let them
return hex. Only now it caught my eye that hex-coding in
digest() is wrong. When doing digest() I thought about 'common
case' but hacking with psql is probably _not_ the common case :)

Marko Kreen

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian - CVS 2001-01-24 03:50:06 pgsql/src/backend/main main.c
Previous Message Bruce Momjian - CVS 2001-01-24 03:42:38 pgsql/src bin/psql/command.c include/config.h. ...