Re: Re: Unable to store SHA hash (Non-HTML--Sorry) - Mailing list pgsql-jdbc

From David Wall
Subject Re: Re: Unable to store SHA hash (Non-HTML--Sorry)
Date
Msg-id 013501c0d430$a327ff00$5a2b7ad8@expertrade.com
Whole thread Raw
In response to Unable to store SHA hash (Non-HTML--Sorry)  ("Jerry Reid" <jereid@hotmail.com>)
List pgsql-jdbc
> In my code where I need to store short pieces of binary data (like
> digests) I encode them in hex and store the hex.  Yes this results in a
> 2 times increase in storage, and some overhead in encoding/decodeing,
> but it isn't too bad.  Sure you could use other encodings for the binary
> data, but I find hex to be the easiest for small amounts of data.

We use base64 which converts every 3 characters into 4 (as I recall) for
such short things.  For longer, type oid in sql works with
setBytes()/getBytes() in JDBC2, but what the overhead is for a small amount
of binary data I don't know.

David


pgsql-jdbc by date:

Previous
From: Barry Lind
Date:
Subject: Re: Unable to store SHA hash (Non-HTML--Sorry)
Next
From: "Subhramanya Shiva"
Date:
Subject: How to encode and decode a string as a password field in pgsql table?