1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 22:58:07 +02:00

Fix the MD5 computation in the src/core/writer.js file

Currently the MD5 computation doesn't actually work (at all?), since we're invoking the `calculateMD5` function without providing all of the necessary parameters and the PDF-data thus isn't taken into account.

Fixing this caused unit-tests to fail, which isn't that surprising since the current date/time is used in the MD5 computation, and we thus utilize Jasmine to work-around that.
This commit is contained in:
Jonas Jenwald 2025-03-20 14:00:40 +01:00
parent cd4a30341f
commit e6c869c127
2 changed files with 14 additions and 5 deletions

View file

@ -189,7 +189,7 @@ function computeMD5(filesize, xrefInfo) {
writeString(str, offset, array);
offset += str.length;
}
return bytesToString(calculateMD5(array));
return bytesToString(calculateMD5(array, 0, array.length));
}
function writeXFADataForAcroform(str, changes) {