This part looks wrong:
zlib.js/zip.js at develop · imaya/zlib.js · GitHub
for (j = 0; j < 12; ++j) {
buffer[j] = this.encode(
key,
i === 11 ? (file.crc32 & 0xff) : (Math.random() * 256 | 0)
);
}
Specifically the condition i === 1 looks wrong. j is used in this loop. i is used in an outer loop and won't change in this loop.
This wrong condition will prevent it from correctiy storing CRC information and make the resulting file incompatible with commonly-used decompression tools.
This part looks wrong:
zlib.js/zip.js at develop · imaya/zlib.js · GitHub
Specifically the condition
i === 1looks wrong.jis used in this loop.iis used in an outer loop and won't change in this loop.This wrong condition will prevent it from correctiy storing CRC information and make the resulting file incompatible with commonly-used decompression tools.