(str: string)
| 57 | }; |
| 58 | |
| 59 | function djb2(str: string): number { |
| 60 | let h = 5381; |
| 61 | for (let i = 0; i < str.length; i++) { |
| 62 | h = ((h << 5) + h + str.charCodeAt(i)) | 0; |
| 63 | } |
| 64 | return Math.abs(h); |
| 65 | } |
| 66 | |
| 67 | // ─── Theme-aware color cache ──────────────────────────────────────────── |
| 68 |