MCPcopy Create free account
hub / github.com/TeaCoder52/patcode / collisionRisk

Function collisionRisk

src/analyze.ts:44–63  ·  view source on GitHub ↗
(
	code: string,
	entropy: number
)

Source from the content-addressed store, hash-verified

42}
43
44function collisionRisk(
45 code: string,
46 entropy: number
47): 'low' | 'medium' | 'high' {
48 if (code.length === 4) {
49 // Max entropy ~8 bits
50 if (entropy > 6.5) return 'low'
51 if (entropy > 3.5) return 'medium'
52 return 'high'
53 }
54
55 if (code.length === 6) {
56 // Max entropy ~12 bits
57 if (entropy > 10) return 'low'
58 if (entropy > 6) return 'medium'
59 return 'high'
60 }
61
62 return 'high'
63}
64
65function memorabilityScore(
66 code: string,

Callers 1

analyzeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected