MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / query_graph_params_hash

Function query_graph_params_hash

src/mcp/mcp.c:5645–5660  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5643}
5644
5645static uint64_t query_graph_params_hash(const char *project, const char *query, const char *graph) {
5646 static const char domain[] = "cbm.query_graph.params.v1";
5647 cbm_sha256_ctx sha;
5648 cbm_sha256_init(&sha);
5649 cbm_sha256_update(&sha, domain, sizeof(domain));
5650 query_graph_sha_field(&sha, project);
5651 query_graph_sha_field(&sha, query);
5652 query_graph_sha_field(&sha, graph);
5653 uint8_t digest[CBM_SHA256_DIGEST_LEN];
5654 cbm_sha256_final(&sha, digest);
5655 uint64_t hash = 0;
5656 for (int index = 0; index < 8; index++) {
5657 hash = (hash << 8U) | digest[index];
5658 }
5659 return hash;
5660}
5661
5662static void query_graph_result_digest(const cbm_cypher_result_t *result,
5663 char out[CBM_SHA256_HEX_LEN + 1]) {

Callers 1

handle_query_graphFunction · 0.85

Calls 4

cbm_sha256_initFunction · 0.85
cbm_sha256_updateFunction · 0.85
query_graph_sha_fieldFunction · 0.85
cbm_sha256_finalFunction · 0.85

Tested by

no test coverage detected