(entries: readonly PackageEntry[])
| 85 | } |
| 86 | |
| 87 | function fingerprintEntries(entries: readonly PackageEntry[]): string { |
| 88 | const hash = createHash('sha256'); |
| 89 | for (const entry of entries) { |
| 90 | hash.update(entry.archivePath); |
| 91 | hash.update('\0'); |
| 92 | hash.update(String(entry.size)); |
| 93 | hash.update('\0'); |
| 94 | hash.update(String(Math.trunc(entry.mtimeMs))); |
| 95 | hash.update('\n'); |
| 96 | } |
| 97 | return hash.digest('hex'); |
| 98 | } |
no test coverage detected