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

Questions about Calculate SHA1 #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

starandtina
Copy link

Hi guys,

First of all, thanks for your work. I'm not going want to merge this PR but I don't have any chances to submit my issues and talk with you guys directly.

I'm using archiver package to create the zip file and then upload it into my in-house nexus server, but I encounter one issue, the SHA1 value calculated by nexus-deployer is different with the one calculated by openssl sha1 xxx.zip, so that the validation failed.

Here is my code used to generate the zip file:

    const output = fs.createWriteStream(destZipFilePath)

    output.on('close', resolve)
    output.on('error', reject)

    archive.pipe(output)

    archive.bulk([{
      cwd: srcDir,
      src: ['**/*'],
      expand: true
    }])

    archive.finalize()

After digging a while, I removed the encoding configuration for the code below and then it works:

var artifactData = fs.readFileSync(options.artifact, {encoding: 'binary'});

Is there any idea for that? Or Is there something I had missed?

Thanks in advance! I'm looking forward to your response. :)

-zx

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

Successfully merging this pull request may close these issues.

1 participant