+static int
+hashStr(HashTable *table, char *key)
+{
+ int h, bucket;
+ char *s;
+
+ s = key;
+ for (h=0; *s; s++) {
+ h *= 128;
+ h += *s;
+ h = h % 1048583; /* some random large prime */
+ }
+
+ /* Mod the size of the hash table (a power of 2) */
+ bucket = h & table->mask1;
+
+ if (bucket < table->split) {
+ /* Mod the size of the expanded hash table (also a power of 2) */
+ bucket = h & table->mask2;
+ }
+
+ return bucket;
+}
+
+static int
+compareWord(StgWord key1, StgWord key2)
+{
+ return (key1 == key2);
+}
+
+static int
+compareStr(StgWord key1, StgWord key2)
+{
+ return (strcmp((char *)key1, (char *)key2) == 0);
+}
+
+