(paths: string[])
| 129 | * rows; FNV-1a, because it must be deterministic, short and synchronous. |
| 130 | */ |
| 131 | export function collectionKeyForFiles(paths: string[]) { |
| 132 | let hash = 0x811c9dc5; |
| 133 | for (const char of [...paths].sort().join('\n')) { |
| 134 | hash ^= char.charCodeAt(0); |
| 135 | hash = Math.imul(hash, 0x01000193) >>> 0; |
| 136 | } |
| 137 | return `files:${paths.length}:${hash.toString(36)}`; |
| 138 | } |
no test coverage detected