All pastes #806600 Raw Edit

Mine

public text v1 · immutable
·published 2007-12-05 19:16 UTC
rendered paste body
   /* hash:  form hash value for string s */
   unsigned hash(char *s)
   {
       unsigned hashval;

       for (hashval = 0; *s != '\0'; s++)
           hashval = *s + 31 * hashval;
       return hashval % HASHSIZE;
   }