char **strings, int *hash_table, int hash_table_size) {
unsigned int code = 0;
+ // 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)
+
for(int k = 0; new_string[k]; k++) {
- code += int(new_string[k]) << (8 * k%4);
+ code = code * 387433 + (unsigned int) (new_string[k]);
}
code = code % hash_table_size;
}
else {
- cerr << "Selector version " << VERSION
+ cerr << "Selector version " << VERSION << "-R" << REVISION_NUMBER
<< endl
<< "Written by Francois Fleuret <francois@fleuret.org>"
<< endl