int hash(const char *str) { if (str != 0) { unsigned h = str [0]; for (int i = 1; str [i] != 0; ++i) h = (h << 5) - h + str [i]; return h % HASH_SIZE; // remainder } else { return -1; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)