home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d1xx
/
d191
/
ispell.lha
/
ISpell
/
src.zoo
/
hash.c
< prev
next >
Wrap
Text File
|
1989-02-22
|
350b
|
28 lines
/* -*- Mode:Text -*- */
/*
* hash.c - a simple hash function for ispell
*
* Pace Willisson, 1983
*/
hash (s, n, hashsize)
register char *s;
register n;
register hashsize;
{
register short h = 0;
while (n--) {
h ^= *s++;
if (h < 0) {
h <<= 1;
h++;
} else {
h <<= 1;
}
}
h &= 077777;
return (unsigned long) h % hashsize;
}