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

Function hash_djb2

db/utils.c:10–16  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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