(template)
| 183 | } |
| 184 | |
| 185 | function 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 | |
| 195 | function registerTemplate(template) { |
| 196 | const key = getTemplateKey(template) |
no test coverage detected