/* A quick and dirty hash table */
+#define MAGIC_HASH_MULTIPLIER 387433
+
/* The table itself stores indexes of the strings taken in a char**
table. When a string is added, if it was already in the table, the
new index replaces the previous one. */
int k;
/* This is my recipe. I checked, it seems to work (as long as
- hash_table->size is not a multiple of 387433 that should be
- okay) */
+ hash_table->size is not a multiple of MAGIC_HASH_MULTIPLIER that
+ should be okay) */
for(k = 0; new_string[k]; k++) {
- code = code * 387433 + (unsigned int) (new_string[k]);
+ code = code * MAGIC_HASH_MULTIPLIER + (unsigned int) (new_string[k]);
}
code = code % hash_table->size;