home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
495a.lha
/
ISpell_v3.1ljr
/
src
/
hash.c
< prev
next >
Wrap
Text File
|
1991-04-06
|
311b
|
26 lines
/*
* hash.c - a simple hash function for ispell
*
* Pace Willisson, 1983
*/
unsigned int hash (char *s, int n, int hashsize)
{
short h = 0;
while (n--)
{
h ^= *s++;
if (h < 0)
{
h <<= 1;
h++;
}
else
h <<= 1;
}
h &= 077777;
return (unsigned int) h % hashsize;
}