uint32_t FWadCollection::LumpNameHash (const char *s) { const uint32_t *table = GetCRCTable ();; uint32_t hash = 0xffffffff; int i; for (i = 8; i > 0 && *s; --i, ++s) { hash = CRC1 (hash, *s, table); } return hash ^ 0xffffffff; }
static int ModelFrameHash(FSpriteModelFrame * smf) { const uint32_t *table = GetCRCTable (); uint32_t hash = 0xffffffff; const char * s = (const char *)(&smf->type); // this uses type, sprite and frame for hashing const char * se= (const char *)(&smf->hashnext); for (; s<se; s++) { hash = CRC1 (hash, *s, table); } return hash ^ 0xffffffff; }