MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / adfGetHashValue

Function adfGetHashValue

dep/adflib/src/adf_dir.c:839–857  ·  view source on GitHub ↗

* adfGetHashValue * */

Source from the content-addressed store, hash-verified

837 *
838 */
839 int
840adfGetHashValue(uint8_t *name, BOOL intl)
841{
842 uint32_t hash, len;
843 unsigned int i;
844 uint8_t upper;
845
846 len = hash = strlen((char*)name);
847 for(i=0; i<len; i++) {
848 if (intl)
849 upper = adfIntlToUpper(name[i]);
850 else
851 upper = toupper(name[i]);
852 hash = (hash * 13 + upper) & 0x7ff;
853 }
854 hash = hash % HT_SIZE;
855
856 return(hash);
857}
858
859
860/*

Callers 4

adfRenameEntryFunction · 0.85
adfRemoveEntryFunction · 0.85
adfNameToEntryBlkFunction · 0.85
adfCreateEntryFunction · 0.85

Calls 1

adfIntlToUpperFunction · 0.85

Tested by

no test coverage detected