MCPcopy Create free account
hub / github.com/1a1a11a/libCacheSim / spp_mix_32

Function spp_mix_32

libCacheSim/dataStructure/sparsepp/spp_utils.h:178–184  ·  view source on GitHub ↗

from http://burtleburtle.net/bob/hash/integer.html fast and efficient for power of two table sizes where we always consider the last bits. ---------------------------------------------------------------

Source from the content-addressed store, hash-verified

176// consider the last bits.
177// ---------------------------------------------------------------
178inline size_t spp_mix_32(uint32_t a)
179{
180 a = a ^ (a >> 4);
181 a = (a ^ 0xdeadbeef) + (a << 5);
182 a = a ^ (a >> 11);
183 return static_cast<size_t>(a);
184}
185
186// More thorough scrambling as described in
187// https://gist.github.com/badboy/6267743

Callers 5

spp_hash<int16_t>Class · 0.85
spp_hash<uint16_t>Class · 0.85
spp_hash<int32_t>Class · 0.85
spp_hash<uint32_t>Class · 0.85
spp_hash<float>Class · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected