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

Function memihash

hashmap.c:40–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40unsigned 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

Callers 6

find_dir_entryFunction · 0.85
hash_dir_entryFunction · 0.85
hash_index_entryFunction · 0.85
handle_range_1Function · 0.85
index_file_existsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected