Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!van-bc!ubc-cs!alberta!herald.usask.ca!weyr!f70.n140.z1.FIDONET.ORG!David.Plummer From: David.Plummer@f70.n140.z1.FIDONET.ORG (David Plummer) Newsgroups: comp.sys.amiga Subject: CATS? ANYONE? Message-ID: <2.27842025@weyr.FIDONET.ORG> Date: 3 Jan 91 07:13:28 GMT Sender: ufgate@weyr.FIDONET.ORG (newsout1.26) Organization: FidoNet node 1:140/70 - Double Check, Regina Sask Lines: 29 Below is the function I'm using to calculate the hash value for a filename: int Hash(unsigned char *filename) { int val; val=strlen(filename); while(*filename) val=((val*13)+(int)toupper(*filename++)) & 0x7ff; return (val % 72); } My question is, should I use modulus 72? Or should I use %(blocksize-56)? Or should I use %(buffer[3]), which is supposed to reflect the size of the hash table? With 512 byte sectors, 72 works fine, but in order to be upwardly compatible, will the hash function change to reflect the larger sector size (and therefor, I assume, a larger hash table)? Any opinions (or correct answers!) would be appreciated. Thanks... -- David Plummer - via FidoNet node 1:140/22 UUCP: ...!herald!weyr!70!David.Plummer Domain: David.Plummer@f70.n140.z1.FIDONET.ORG Standard Disclaimers Apply...