Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: What is "CheckSum" in Hashing

Author: Daniel Clausen

Date: 07:19:05 06/21/01

Go up one level in this thread


Hi

On June 21, 2001 at 09:56:50, Cheok Yan Cheng wrote:
[snip]
>
>For "hash value" x, I understand that it is generated using XOR from the table :
>64_bit_random_number[PIECE_TYPE][PIECE_LOCATION].
>
>1. For the "hash value" y that used for checksum, how should we generated it?
>2. What is checksum for ?

Let's say we have a hash value of 64bit for a position and a hashtable with 2^20
slots. We then take the first (or last or whatever) 20 bit of the hash value for
the index in the hashtable. The other 64-20-44 bit are stored as checksum.

So basically the checksum consists of the bits of the hash value which didn't go
into the index:

   xxxxxxxxxxyyyyyyyyyyyyyyyyyyyyyy    // 64 bit hash value for position
   xxxxxxxxxx                          // 20 bit used a index for hash table
             yyyyyyyyyyyyyyyyyyyyyy    // 44 bit stored as checksum

If we would use a hashtable with 2^64 entries, the whole hash value would be
used as index into the table and we wouldn't need a checksum. Unfortunately we
don't have that much memory. :)

Hope this helps. I'm sure there are other programmers who can explain this in a
much clearer way...

Regards,

Sargon



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.