Skip to content

Questions about Calculate SHA1#5

Open
starandtina wants to merge 1 commit intocthorne66:masterfrom
starandtina:master
Open

Questions about Calculate SHA1#5
starandtina wants to merge 1 commit intocthorne66:masterfrom
starandtina:master

Conversation

@starandtina
Copy link
Copy Markdown

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