MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / WeakHashLen32WithSeeds

Function WeakHashLen32WithSeeds

Sources/nCine/Base/HashFunctions.cpp:342–351  ·  view source on GitHub ↗

Return a 16-byte hash for 48 bytes. Quick and dirty. Callers do best to use "random-looking" values for a and b.

Source from the content-addressed store, hash-verified

340 // Return a 16-byte hash for 48 bytes. Quick and dirty.
341 // Callers do best to use "random-looking" values for a and b.
342 static std::pair<std::uint64_t, std::uint64_t> WeakHashLen32WithSeeds(std::uint64_t w, std::uint64_t x, std::uint64_t y, std::uint64_t z, std::uint64_t a, std::uint64_t b)
343 {
344 a += w;
345 b = Rotate(b + a + z, 21);
346 std::uint64_t c = a;
347 a += x;
348 a += y;
349 b += Rotate(a, 44);
350 return std::make_pair(a + z, b + c);
351 }
352
353 // Return a 16-byte hash for s[0] ... s[31], a, and b. Quick and dirty.
354 static std::pair<std::uint64_t, std::uint64_t> WeakHashLen32WithSeeds(const char* s, std::uint64_t a, std::uint64_t b)

Callers 1

CityHash64Function · 0.85

Calls 2

RotateFunction · 0.85
Fetch64Function · 0.85

Tested by

no test coverage detected