Skip to content

armgit / xerj

Public Imported from GitHub
0

AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search without grep, agent memory and RAG. Elasticsearch-compatible API; Corpus Hub serves hundreds of reference memory corpora.

294 B
Raw Blame
#include "limits.h"

#define MINI_HASH_SEED 5381

/* A tiny djb2 hash, bounded to MINI_LIMIT buckets. */
unsigned long mini_hash(const char *s)
{
    unsigned long h = MINI_HASH_SEED;
    int c;
    while ((c = *s++))
        h = ((h << 5) + h) + (unsigned long)c;
    return h % MINI_LIMIT;
}