On Mon, Nov 10, 2008 at 11:31:33PM +0000, Gregory Stark wrote:
> No, I just meant that you could calculate the CRC by scanning the whole buffer
> efficiently using one of the good word-wise CRC algorithms, then look at the
> line pointers to find the hint bits and subtract them out of the CRC. The
> result should be zero after adjusting for the hint bits.
If you're going to look at the line pointers anyway, couldn't you just
do it in one pass, like:
n = 0
next = &tuple[n].hintbits
pos = 0
while pos < BLOCK_SIZE: if pos == next: CRC_ADD( block[pos] & mask ) n++ next = &tuple[n].hintbits # If n ==
numtups,next = BLOCK_SIZE else: CRC_ADD( block[pos] pos++
This only handles one byte of hintbits but can easily be extended. No
need to actually *store* the hintbit free version anywhere...
Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.