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

Function ta_unhex

src/mcp/test_impact_engine_artifact.c:38–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38static bool ta_unhex(const char *hex, unsigned char bytes[32]) {
39 if (!hex || strlen(hex) != 64) {
40 return false;
41 }
42 for (int i = 0; i < 64; i++) {
43 char ch = hex[i];
44 int v = ch >= '0' && ch <= '9' ? ch - '0' : ch >= 'a' && ch <= 'f' ? ch - 'a' + 10 : -1;
45 if (v < 0) {
46 return false;
47 }
48 bytes[i / 2] = (unsigned char)(i % 2 ? (bytes[i / 2] | v) : (v << 4));
49 }
50 return true;
51}
52
53/* The exact graph digest of a database: what an importer of it measures. */
54bool te_db_digest(const char *db_path, char hex[65]) {

Callers 1

te_artifact_receiptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected