UNPKG

scai

Version:

> **A local-first AI CLI for understanding, querying, and iterating on large codebases.** > **100% local • No token costs • No cloud • No prompt injection • Private by design**

15 lines (14 loc) 525 B
import crypto from 'crypto'; import path from 'path'; import { normalizePath } from './contentUtils.js'; /** * Generate a stable unique key for a repo path. * Uses the basename plus a short hash of the full path. * Example: "sps-1a2b3c" */ export function getHashedRepoKey(repoPath) { const absPath = normalizePath(repoPath); // now cross-platform consistent const base = path.basename(absPath); const hash = crypto.createHash('md5').update(absPath).digest('hex').slice(0, 6); return `${base}-${hash}`; }