(text: string)
| 41 | * Create unique number identifier for @text |
| 42 | */ |
| 43 | export function hashCode(text: string): number { |
| 44 | let i, chr, len; |
| 45 | let hash = 0; |
| 46 | |
| 47 | for (i = 0, len = text.length; i < len; i++) { |
| 48 | chr = text.charCodeAt(i); |
| 49 | hash = (hash << 5) - hash + chr; |
| 50 | hash |= 0; // Convert to 32bit integer |
| 51 | } |
| 52 | |
| 53 | return hash; |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * @description Finds the maximum value in an array of numbers safely |
no outgoing calls
no test coverage detected
searching dependent graphs…