| 38 | } |
| 39 | |
| 40 | unsigned int memihash(const void *buf, size_t len) |
| 41 | { |
| 42 | unsigned int hash = FNV32_BASE; |
| 43 | unsigned char *ucbuf = (unsigned char *) buf; |
| 44 | while (len--) { |
| 45 | unsigned int c = *ucbuf++; |
| 46 | if (c >= 'a' && c <= 'z') |
| 47 | c -= 'a' - 'A'; |
| 48 | hash = (hash * FNV32_PRIME) ^ c; |
| 49 | } |
| 50 | return hash; |
| 51 | } |
| 52 | |
| 53 | /* |
| 54 | * Incorporate another chunk of data into a memihash |
no outgoing calls
no test coverage detected