(text: string)
| 308 | } |
| 309 | |
| 310 | function hashContent(text: string): string { |
| 311 | let h = 0; |
| 312 | for (let i = 0; i < text.length; i++) h = ((h << 5) - h + text.charCodeAt(i)) | 0; |
| 313 | return h.toString(36); |
| 314 | } |
| 315 | |
| 316 | function cosine(a: number[], b: number[]): number { |
| 317 | let dot = 0, normA = 0, normB = 0; |