//This is case insensitive as it should be
unsigned int hash(const char *word) { // TODO: Improve this hash function if ((strlen(word)) <4 ) { return (tolower(word[0]) - 'a'); } else { return (26 + ((676 * (tolower(word[0]) - 'a')) + (26 * (tolower(word[1]) - 'a')) + (tolower(word[2] - 'a')))); } } // This is not case insensitive
unsigned int hash(const char *word) { // TODO: Improve this hash function if ((strlen(word)) <3 ) { return (tolower(word[0]) - 'a'); } // else if(strlen(word)==3){ // return (26 + ((26 * (tolower(word[0]) - 'a')) + 26*(tolower(word[1]) - 'a'))); // } else { return (26 + ((676 * (tolower(word[0]) - 'a')) + (26 * (tolower(word[1]) - 'a')) + (tolower(word[2] - 'a')))); } } //Only difference is <3 and <4 in if condition