MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / GetFileHash

Function GetFileHash

Source/Utility/hash.cpp:42–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42MurmurHash GetFileHash(const char* file) {
43 std::vector<unsigned char> data = readFile(file);
44
45 MurmurHash hash;
46 memset(&hash, 0, sizeof(MurmurHash));
47
48 if (data.size() == 0) {
49 return hash;
50 }
51
52 MurmurHash3_x86_128(&data[0], data.size(), 1337, hash.hash);
53
54 return hash;
55}

Callers 4

LoadMethod · 0.85
OgdaGetFileHashFunction · 0.85
CalculateHashMethod · 0.85
CalculateHashMethod · 0.85

Calls 3

readFileFunction · 0.85
MurmurHash3_x86_128Function · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected