(str: string)
| 17 | } |
| 18 | |
| 19 | function djb2(str: string): number { |
| 20 | let hash = 5381; |
| 21 | for (let i = 0; i < str.length; i++) { |
| 22 | hash = ((hash << 5) + hash) + str.charCodeAt(i); /* hash * 33 + c */ |
| 23 | } |
| 24 | return hash; |
| 25 | } |
| 26 | |
| 27 | // tslint:disable-next-line:max-line-length |
| 28 | const COLORS: string[] = ['#C0392B', '#9B59B6', '#2980B9', '#1ABC9C', '#16A085', '#F1C40F', '#E67E22', '#D35400', '#E74C3C', '#8E44AD', '#3498DB', '#2ECC71', '#F39C12']; |