* Incorporate another chunk of data into a memihash * computation. */
| 55 | * computation. |
| 56 | */ |
| 57 | unsigned int memihash_cont(unsigned int hash_seed, const void *buf, size_t len) |
| 58 | { |
| 59 | unsigned int hash = hash_seed; |
| 60 | unsigned char *ucbuf = (unsigned char *) buf; |
| 61 | while (len--) { |
| 62 | unsigned int c = *ucbuf++; |
| 63 | if (c >= 'a' && c <= 'z') |
| 64 | c -= 'a' - 'A'; |
| 65 | hash = (hash * FNV32_PRIME) ^ c; |
| 66 | } |
| 67 | return hash; |
| 68 | } |
| 69 | |
| 70 | #define HASHMAP_INITIAL_SIZE 64 |
| 71 | /* grow / shrink by 2^2 */ |
no outgoing calls
no test coverage detected