(str: string)
| 353 | } |
| 354 | |
| 355 | function shortHash(str: string): string { |
| 356 | let h = 0 |
| 357 | for (let i = 0; i < str.length; i++) { |
| 358 | h = ((h << 5) - h + str.charCodeAt(i)) | 0 |
| 359 | } |
| 360 | return Math.abs(h).toString(36).slice(0, 6) |
| 361 | } |
| 362 | |
| 363 | function jsonResponse(data: unknown, status: number): Response { |
| 364 | return new Response(JSON.stringify(data), { |