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

Function Com_HashKey

codemp/qcommon/common.cpp:650–659  ·  view source on GitHub ↗

============ Com_HashKey ============ */

Source from the content-addressed store, hash-verified

648============
649*/
650int Com_HashKey(char *string, int maxlen) {
651 int hash, i;
652
653 hash = 0;
654 for (i = 0; i < maxlen && string[i] != '\0'; i++) {
655 hash += string[i] * (119 + i);
656 }
657 hash = (hash ^ (hash >> 10) ^ (hash >> 20));
658 return hash;
659}
660
661/*
662================

Callers 2

CL_WritePacketFunction · 0.85
SV_UserMoveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected