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**
9 lines (8 loc) • 431 B
JavaScript
import path from 'path';
import crypto from 'crypto';
// put this helper at top-level (or import from shared utils)
export function getUniqueId(name, filePath, startLine, startColumn, content) {
const normalizedPath = path.normalize(filePath).replace(/\\/g, '/');
const hash = crypto.createHash('md5').update(content).digest('hex').slice(0, 6);
return `${name}@${normalizedPath}:${startLine}:${startColumn}:${hash}`;
}