MCPcopy Create free account
hub / github.com/Dhravya/notty / contentHash

Method contentHash

src/durable-objects/user-notes.ts:321–327  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

319 const branch = this.getCurrentBranch(noteId);
320 const parentId = branch.head_version_id;
321 const hash = this.contentHash(content);
322
323 const head = parentId ? this.sql.exec(
324 "SELECT id, kind, storage, data, content_hash, created_at FROM note_versions WHERE id = ?", parentId
325 ).toArray()[0] as any : null;
326
327 // Identical to head → nothing to record
328 if (head?.content_hash && head.content_hash === hash) return null;
329
330 // Defense-in-depth: never record an accidental wipe as a version. A

Callers 1

fetchMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected