Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Hash codes

Author: David Hanley

Date: 17:02:43 11/13/01

Go up one level in this thread


I think we're on the same page.  I'm using the zorbist function in my program.
I'm just trying to create better hash values than simply using the built-in
random function by making sure that no two codes have fewer than eight bits
different than any other code.  In C pseudocode, it's essentially:

zorbist_keys

make_zorbist_key()
{
  do
     key = random( 1 power key_length );
  while( key not_similar_to_any zorbist_keys );

  add key to zorbist_keys;
  return key;
}

It seems that by making sure each code has at least 8 bits different than any
other, i should greatly reduce the incidence of hash collisions, especially if
rand() is "funky."

I'll probably still bump the length up to 64, as you suggest.

Thanks for your help!  That tutorial page seems pretty good.

dave



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.