Thread: CRC32 function

CRC32 function

From
"Ilia Kantor"
Date:

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

 

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

 

 

 

Attachment

Re: CRC32 function

From
Bruce Momjian
Date:
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

Re: CRC32 function

From
Bruno Wolff III
Date:
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.

Re: CRC32 function

From
Bruce Momjian
Date:
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

Re: CRC32 function

From
Tom Lane
Date:
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

Re: CRC32 function

From
Bruno Wolff III
Date:
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.