MCPcopy Create free account
hub / github.com/codeaashu/claude-code / computeChecksum

Function computeChecksum

src/services/policyLimits/index.ts:152–159  ·  view source on GitHub ↗

* Compute a checksum from restrictions content for HTTP caching

(
  restrictions: PolicyLimitsResponse['restrictions'],
)

Source from the content-addressed store, hash-verified

150 * Compute a checksum from restrictions content for HTTP caching
151 */
152function computeChecksum(
153 restrictions: PolicyLimitsResponse['restrictions'],
154): string {
155 const sorted = sortKeysDeep(restrictions)
156 const normalized = jsonStringify(sorted)
157 const hash = createHash('sha256').update(normalized).digest('hex')
158 return `sha256:${hash}`
159}
160
161/**
162 * Check if the current user is eligible for policy limits.

Callers 1

fetchAndLoadPolicyLimitsFunction · 0.85

Calls 3

jsonStringifyFunction · 0.85
sortKeysDeepFunction · 0.70
updateMethod · 0.65

Tested by

no test coverage detected