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

Function instance_key_valid

src/daemon/ipc.c:56–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56static bool instance_key_valid(const char *key) {
57 if (!key) {
58 return false;
59 }
60 for (size_t i = 0; i < 16; i++) {
61 char ch = key[i];
62 bool decimal = ch >= '0' && ch <= '9';
63 bool lower = ch >= 'a' && ch <= 'f';
64 if (!decimal && !lower) {
65 return false;
66 }
67 }
68 return key[16] == '\0';
69}
70
71static char *string_copy(const char *value) {
72 if (!value) {

Calls

no outgoing calls

Tested by

no test coverage detected