DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦0ecbbcab5⟧ TextFile

    Length: 343 (0x157)
    Types: TextFile
    Names: »hash.c«

Derivation

└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
    └─ ⟦this⟧ »EUUGD11/euug-87hel/sec1/ispell/hash.c« 

TextFile

/* -*- 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 (h %= hashsize);
}