MCPcopy Create free account
hub / github.com/TanStack/cli / getTemplateKey

Function getTemplateKey

packages/create/scripts/generate-manifest.mjs:185–193  ·  view source on GitHub ↗
(template)

Source from the content-addressed store, hash-verified

183}
184
185function getTemplateKey(template) {
186 let hash = 0x811c9dc5
187 for (let i = 0; i < template.length; i++) {
188 hash ^= template.charCodeAt(i)
189 hash = Math.imul(hash, 0x01000193) >>> 0
190 }
191
192 return `${hash.toString(16).padStart(8, '0')}:${template.length}`
193}
194
195function registerTemplate(template) {
196 const key = getTemplateKey(template)

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected