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

Function fingerprint_valid

src/daemon/service.c:74–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74static bool fingerprint_valid(const char *fingerprint) {
75 size_t length = 0;
76 if (!bounded_length(fingerprint, CBM_DAEMON_BUILD_FINGERPRINT_SIZE, &length) ||
77 length != CBM_SHA256_HEX_LEN) {
78 return false;
79 }
80 for (size_t i = 0; i < length; i++) {
81 char ch = fingerprint[i];
82 if (!((ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'f'))) {
83 return false;
84 }
85 }
86 return true;
87}
88
89static bool optional_fingerprint_valid(const char *fingerprint) {
90 return !fingerprint || !fingerprint[0] || fingerprint_valid(fingerprint);

Callers 3

identity_validFunction · 0.85
conflict_validFunction · 0.85

Calls 1

bounded_lengthFunction · 0.85

Tested by

no test coverage detected