Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Produce the same zip file all time #762

Open
AlttiRi opened this issue May 5, 2024 · 1 comment
Open

Produce the same zip file all time #762

AlttiRi opened this issue May 5, 2024 · 1 comment

Comments

@AlttiRi
Copy link

AlttiRi commented May 5, 2024

Currently, the hash of each zip archive is unique.
Seems, archiver adds the archiving time in the zip file.

Is it possibly to skip this? I need the reproducible result.

For example, 7zip always generates the same zips for the same input.


I use that:

export async function zipDirectory(sourceDir, outPath) {
    const archive = archiver("zip");
    const writeStream = fs.createWriteStream(outPath);
    const readStream = archive.directory(sourceDir, "");
    await archive.finalize();
    await pipeline(readStream, writeStream);
}
@AlttiRi
Copy link
Author

AlttiRi commented May 5, 2024

Alternatively, I would like to have an ability to get the result zip's CRC hash of the data inside it.
I assume archiver computes this, but just not exposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant