MCPcopy Create free account
hub / github.com/JACoders/OpenJK / HashFunction

Function HashFunction

code/qcommon/hstring.cpp:192–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190
191
192int HashFunction(const char *key)
193{
194 long hash=0;
195 int i=0;
196 unsigned char letter;
197
198 letter = (unsigned char)*key++;
199 while (letter)
200 {
201 hash += (long)(letter) * (i + 119);
202 i++;
203 letter = (unsigned char)*key++;
204 }
205 hash &= MAX_HASH - 1;
206 return (int)hash;
207}
208
209
210class CHashHelper

Callers 1

InitMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected