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

Function cv_hash_bytes

src/mcp/test_impact_coverage.c:28–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26};
27
28static void cv_hash_bytes(const char *bytes, size_t len, char hex[CBM_SHA256_HEX_LEN + 1]) {
29 cbm_sha256_ctx hash;
30 cbm_sha256_init(&hash);
31 if (len)
32 cbm_sha256_update(&hash, bytes, len);
33 uint8_t digest[CBM_SHA256_DIGEST_LEN];
34 cbm_sha256_final(&hash, digest);
35 static const char digits[] = "0123456789abcdef";
36 for (int i = 0; i < CBM_SHA256_DIGEST_LEN; i++) {
37 hex[i * 2] = digits[digest[i] >> 4];
38 hex[i * 2 + 1] = digits[digest[i] & 15];
39 }
40 hex[CBM_SHA256_HEX_LEN] = '\0';
41}
42
43static bool cv_records(const char *text, size_t len, int *count) {
44 *count = 0;

Callers 2

cbm_coverage_map_parseFunction · 0.85

Calls 3

cbm_sha256_initFunction · 0.85
cbm_sha256_updateFunction · 0.85
cbm_sha256_finalFunction · 0.85

Tested by

no test coverage detected