agentfootprint
Version:
The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.
26 lines • 1.11 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.sha256 = void 0;
/**
* sha256 — the content hash incremental re-indexing skips on.
*
* Pattern: leaf utility over `node:crypto`.
* Role: rag/ layer. Distinct from `lib/fnv1a` on purpose: FNV-1a identifies
* content for correlation inside one recording, where a collision
* costs a confusing trace. This one decides whether a document is
* RE-EMBEDDED, where a collision costs a stale answer that looks
* exactly like a fresh one — and it is compared across runs, machines
* and months rather than within a single process.
* Emits: N/A.
*/
const lazyRequire_js_1 = require("../lib/lazyRequire.js");
/** Hex sha-256 of the bytes or text given. */
function sha256(input) {
const crypto = (0, lazyRequire_js_1.lazyRequire)('node:crypto');
return crypto
.createHash('sha256')
.update(typeof input === 'string' ? Buffer.from(input, 'utf8') : Buffer.from(input))
.digest('hex');
}
exports.sha256 = sha256;
//# sourceMappingURL=hash.js.map