MCPcopy Create free account
hub / github.com/ElementsProject/lightning / hash_djb2

Function hash_djb2

db/utils.c:8–14  ·  view source on GitHub ↗

Matches the hash function used in devtools/sql-rewrite.py */

Source from the content-addressed store, hash-verified

6
7/* Matches the hash function used in devtools/sql-rewrite.py */
8static u32 hash_djb2(const char *str)
9{
10 u32 hash = 5381;
11 for (size_t i = 0; str[i]; i++)
12 hash = ((hash << 5) + hash) ^ str[i];
13 return hash;
14}
15
16size_t db_query_colnum(const struct db_stmt *stmt,
17 const char *colname)

Callers 2

db_query_colnumFunction · 0.70
db_prepare_v2_Function · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected