MCPcopy
hub / github.com/codeaashu/claude-code / computeFingerprint

Function computeFingerprint

src/utils/fingerprint.ts:50–63  ·  view source on GitHub ↗
(
  messageText: string,
  version: string,
)

Source from the content-addressed store, hash-verified

48 * @returns 3-character hex fingerprint
49 */
50export function computeFingerprint(
51 messageText: string,
52 version: string,
53): string {
54 // Extract chars at indices [4, 7, 20], use "0" if index not found
55 const indices = [4, 7, 20]
56 const chars = indices.map(i => messageText[i] || '0').join('')
57
58 const fingerprintInput = `${FINGERPRINT_SALT}${chars}${version}`
59
60 // SHA256 hash, return first 3 hex chars
61 const hash = createHash('sha256').update(fingerprintInput).digest('hex')
62 return hash.slice(0, 3)
63}
64
65/**
66 * Computes fingerprint from the first user message.

Callers 2

sideQueryFunction · 0.85

Calls 1

updateMethod · 0.65

Tested by

no test coverage detected