* adfGetHashValue * */
| 837 | * |
| 838 | */ |
| 839 | int |
| 840 | adfGetHashValue(uint8_t *name, BOOL intl) |
| 841 | { |
| 842 | uint32_t hash, len; |
| 843 | unsigned int i; |
| 844 | uint8_t upper; |
| 845 | |
| 846 | len = hash = strlen((char*)name); |
| 847 | for(i=0; i<len; i++) { |
| 848 | if (intl) |
| 849 | upper = adfIntlToUpper(name[i]); |
| 850 | else |
| 851 | upper = toupper(name[i]); |
| 852 | hash = (hash * 13 + upper) & 0x7ff; |
| 853 | } |
| 854 | hash = hash % HT_SIZE; |
| 855 | |
| 856 | return(hash); |
| 857 | } |
| 858 | |
| 859 | |
| 860 | /* |
no test coverage detected