MCPcopy Create free account
hub / github.com/arktypeio/arktype / fingerprintOf

Function fingerprintOf

ark/schema/runtime.ts:110–119  ·  view source on GitHub ↗
(config: object)

Source from the content-addressed store, hash-verified

108
109// functions can't be compared
110export const fingerprintOf = (config: object): string => {
111 const text = staticTextOf(config, [])
112 let a = 1
113 let b = 2
114 for (let i = 0; i < text.length; i++) {
115 a = Math.imul(a ^ text.charCodeAt(i), 2654435761)
116 b = Math.imul(b ^ text.charCodeAt(i), 1597334677)
117 }
118 return `${(a >>> 0).toString(36)}_${(b >>> 0).toString(36)}`
119}
120
121const staticTextOf = (value: unknown, seen: unknown[]): string => {
122 if (

Callers 3

standalone.test.tsFile · 0.90
applyConfigurationMethod · 0.90
configureFunction · 0.70

Calls 2

staticTextOfFunction · 0.85
toStringMethod · 0.65

Tested by

no test coverage detected