Eine Zeile im Format von shasum: ` `.
(text)
| 67 | |
| 68 | /** Eine Zeile im Format von shasum: `<hex> <dateiname>`. */ |
| 69 | function parseSums(text) { |
| 70 | return text |
| 71 | .split('\n') |
| 72 | .map((line) => line.trim()) |
| 73 | .filter((line) => line.length > 0 && !line.startsWith('#')) |
| 74 | .map((line) => { |
| 75 | const match = /^([0-9a-f]{64})\s+\*?(.+)$/i.exec(line); |
| 76 | if (match === null) { |
| 77 | return { expected: '', file: line, malformed: true }; |
| 78 | } |
| 79 | return { expected: match[1].toLowerCase(), file: match[2].trim(), malformed: false }; |
| 80 | }); |
| 81 | } |
| 82 | |
| 83 | /** Das kleinste Modell, das die Pruefsummendatei nennt und das wirklich daliegt. */ |
| 84 | function smallestModel(entries) { |