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

Function readiness_hex_decode

src/ui/http_server.c:3115–3128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3113}
3114
3115static bool readiness_hex_decode(const char *hex, uint8_t out[CBM_SHA256_DIGEST_LEN]) {
3116 if (!hex || strlen(hex) != CBM_SHA256_HEX_LEN) {
3117 return false;
3118 }
3119 for (size_t i = 0; i < CBM_SHA256_DIGEST_LEN; i++) {
3120 int high = readiness_hex_nibble(hex[i * 2U]);
3121 int low = readiness_hex_nibble(hex[i * 2U + 1U]);
3122 if (high < 0 || low < 0) {
3123 return false;
3124 }
3125 out[i] = (uint8_t)((high << 4) | low);
3126 }
3127 return true;
3128}
3129
3130static void readiness_hex_encode(const uint8_t bytes[CBM_SHA256_DIGEST_LEN],
3131 char out[CBM_SHA256_HEX_LEN + 1U]) {

Callers 1

handle_ui_readinessFunction · 0.85

Calls 1

readiness_hex_nibbleFunction · 0.85

Tested by

no test coverage detected