// hashfunctions.c - implementation of different hash functions

//----------------------------------------------------------------------
unsigned calculateSimpleStringHash(
  void *string,unsigned alphabet_size,
  unsigned modulus)
{
  unsigned hash = 0;
  char *help = (char*)string;
      // we define the hash value of a NULL string to be 0
  if (!help)
    return(0);
  while(*help)
    hash = ((hash * alphabet_size) + *help++) % modulus;
  return(hash);
}

