MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / hash

Method hash

modules/gui/gui/src/backend/text_server/ustring.cpp:3291–3303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3289}
3290
3291uint32_t String::hash(const char* p_cstr)
3292{
3293 uint32_t hashv = 5381;
3294 uint32_t c = *p_cstr++;
3295
3296 while (c)
3297 {
3298 hashv = ((hashv << 5) + hashv) + c; /* hash * 33 + c */
3299 c = *p_cstr++;
3300 }
3301
3302 return hashv;
3303}
3304
3305uint32_t String::hash(const char* p_cstr, int p_len)
3306{

Callers 2

StringNameMethod · 0.45
searchMethod · 0.45

Calls 1

get_dataFunction · 0.50

Tested by

no test coverage detected