MCPcopy Create free account
hub / github.com/git/git / memihash_cont

Function memihash_cont

hashmap.c:57–68  ·  view source on GitHub ↗

* Incorporate another chunk of data into a memihash * computation. */

Source from the content-addressed store, hash-verified

55 * computation.
56 */
57unsigned 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 */

Callers 2

handle_range_1Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected