MCPcopy Create free account
hub / github.com/DFHack/dfhack / luaS_hash

Function luaS_hash

depends/lua/src/lstring.c:49–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47
48
49unsigned int luaS_hash (const char *str, size_t l, unsigned int seed) {
50 unsigned int h = seed ^ cast(unsigned int, l);
51 size_t step = (l >> LUAI_HASHLIMIT) + 1;
52 for (; l >= step; l -= step)
53 h ^= ((h<<5) + (h>>2) + cast_byte(str[l - 1]));
54 return h;
55}
56
57
58unsigned int luaS_hashlongstr (TString *ts) {

Callers 3

makeseedFunction · 0.85
luaS_hashlongstrFunction · 0.85
internshrstrFunction · 0.85

Calls 1

castFunction · 0.85

Tested by

no test coverage detected