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

Function bytes_hash

src/foundation/mem_events.c:1360–1368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1358 * mixed in, so two strings that share a long prefix still differ. */
1359enum { MEMEV_CONTENT_HASH_MAX = 4096 };
1360static uint64_t bytes_hash(const char *s, size_t len) {
1361 uint64_t h = 0xcbf29ce484222325ULL ^ (uint64_t)len;
1362 size_t n = len < MEMEV_CONTENT_HASH_MAX ? len : MEMEV_CONTENT_HASH_MAX;
1363 for (size_t i = 0; s && i < n; i++) {
1364 h ^= (uint8_t)s[i];
1365 h *= 0x100000001b3ULL;
1366 }
1367 return h;
1368}
1369
1370void cbm_work_note_strlen(void *site, const char *s, size_t len) {
1371 if (!cbm_memev_enabled()) {

Callers 1

cbm_work_note_strlenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected