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

Function readiness_hex_decode

src/ui/http_server.c:1726–1739  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1724}
1725
1726static bool readiness_hex_decode(const char *hex, uint8_t out[CBM_SHA256_DIGEST_LEN]) {
1727 if (!hex || strlen(hex) != CBM_SHA256_HEX_LEN) {
1728 return false;
1729 }
1730 for (size_t i = 0; i < CBM_SHA256_DIGEST_LEN; i++) {
1731 int high = readiness_hex_nibble(hex[i * 2U]);
1732 int low = readiness_hex_nibble(hex[i * 2U + 1U]);
1733 if (high < 0 || low < 0) {
1734 return false;
1735 }
1736 out[i] = (uint8_t)((high << 4) | low);
1737 }
1738 return true;
1739}
1740
1741static void readiness_hex_encode(const uint8_t bytes[CBM_SHA256_DIGEST_LEN],
1742 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