
/* Compute the hash value of the string s using
   method from Kernighan and Ritchie */
unsigned int hashval(const char *s) {
    unsigned int val;
    for (val = 0; *s != '\0'; s++) {
	val = 31*val + *s;
    }
    return val;
}
