Re: Uh, this is *not* a 64-bit CRC ... - Mailing list pgsql-hackers

From Vadim Mikheev
Subject Re: Uh, this is *not* a 64-bit CRC ...
Date
Msg-id 046c01c0a6d9$d9470c40$4879583f@sectorbase.com
Whole thread Raw
In response to Uh, this is *not* a 64-bit CRC ...  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Re: Uh, this is *not* a 64-bit CRC ...  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> This isn't a 64-bit CRC.  It's two independent 32-bit CRCs, one done
> on just the odd-numbered bytes and one on just the even-numbered bytes
> of the datastream.  That's hardly any stronger than a single 32-bit CRC;

I believe that the longer data the more chance to get same CRC/hash
for different data sets (if data length > CRC/hash length). Or am I wrong?
Having no crc64 implementation (see below) I decided to use 2 CRC32 instead
of one - it looked better, without any additional cost (record header is
8 byte aligned anyway, on, mmm, most platform).

> it's certainly not what I thought we had agreed to implement.

I've asked if anyone can send crc64 impl to me and got only one from
Nathan Myers. Unfortunately, SWISS-PROT impl assumes that long long
is 8 bytes - is it portable?

Vadim




pgsql-hackers by date:

Previous
From: Hiroshi Inoue
Date:
Subject: Re: Proposed WAL changes
Next
From: Hiroshi Inoue
Date:
Subject: Re: AW: Proposed WAL changes