CRC32 function

Started by Ilia Kantoralmost 21 years ago6 messagespatches
Jump to latest
#1Ilia Kantor
ilia@obnovlenie.ru

Both backend and users may have a nice use of the function.

Nice and fast hashing when one doesn't need encryption.

Attachments:

crc32.capplication/octet-stream; name=crc32.cDownload
#2Bruce Momjian
bruce@momjian.us
In reply to: Ilia Kantor (#1)
Re: CRC32 function

Ilia Kantor wrote:

Both backend and users may have a nice use of the function.

Nice and fast hashing when one doesn't need encryption.

We already have MD5 encryption in the server. Why would someone want
CRC32?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#3Bruno Wolff III
bruno@wolff.to
In reply to: Bruce Momjian (#2)
Re: CRC32 function

On Thu, Aug 25, 2005 at 16:14:04 -0400,
Bruce Momjian <pgman@candle.pha.pa.us> wrote:

Ilia Kantor wrote:

Both backend and users may have a nice use of the function.

Nice and fast hashing when one doesn't need encryption.

We already have MD5 encryption in the server. Why would someone want
CRC32?

Lower CPU utiliization.

#4Bruce Momjian
bruce@momjian.us
In reply to: Bruno Wolff III (#3)
Re: CRC32 function

Bruno Wolff III wrote:

On Thu, Aug 25, 2005 at 16:14:04 -0400,
Bruce Momjian <pgman@candle.pha.pa.us> wrote:

Ilia Kantor wrote:

Both backend and users may have a nice use of the function.

Nice and fast hashing when one doesn't need encryption.

We already have MD5 encryption in the server. Why would someone want
CRC32?

True, but if there are several million rows, a 32-bit CRC isn't really
useful (too many collisions). I can see it useful in a few cases, but
not for general usefulness.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruno Wolff III (#3)
Re: CRC32 function

Bruno Wolff III <bruno@wolff.to> writes:

Bruce Momjian <pgman@candle.pha.pa.us> wrote:

We already have MD5 encryption in the server. Why would someone want
CRC32?

Lower CPU utiliization.

Like Bruce, I don't really think there is demand for such a function.
But if we were going to offer it, it at least ought to use the existing
implementation in pg_crc.c, instead of duplicating code yet again.

regards, tom lane

#6Bruno Wolff III
bruno@wolff.to
In reply to: Tom Lane (#5)
Re: CRC32 function

On Thu, Aug 25, 2005 at 18:44:13 -0400,
Tom Lane <tgl@sss.pgh.pa.us> wrote:

Bruno Wolff III <bruno@wolff.to> writes:

Bruce Momjian <pgman@candle.pha.pa.us> wrote:

We already have MD5 encryption in the server. Why would someone want
CRC32?

Lower CPU utiliization.

Like Bruce, I don't really think there is demand for such a function.
But if we were going to offer it, it at least ought to use the existing
implementation in pg_crc.c, instead of duplicating code yet again.

Maybe I should have elaborated. I was just responding directly to Bruce's
question. I doubt the CPU usage is a big deal in typical use and that
that the already available cryptographic hashes have advantages such that
I don't expect many people to use CRC32.