powershell - How can I generate the same checksum as artifactory? -


as art.exe (the artifactory cli interface) hangs whenever call build script, rewriting bash script page on topic in powershell 2.0. i'm using code generate checksum:

$sha1 = new-object system.security.cryptography.sha1cryptoserviceprovider $path = resolve-path "catvideos.zip" $bytes = [system.io.file]::readallbytes($path.path) $sha1.computehash($bytes) | foreach { $hash = $hash + $_.tostring("x2") }  $wc=new-object system.net.webclient $wc.credentials= new-object system.net.networkcredential("svnintegration","orange#5") $wc.headers.add("x-checksum-deploy", "true") $wc.headers.add("x-checksum-sha1", $hash) 

the problem consistently produces different checksum on local artifactory generates. it's not 'corruption during transmission' error because i'm generating checksum on local , i've manually deployed several times.

how can generate checksum in same manner artifactory (2.6.5) our checksums match when send mine , deploy won't fail? doing wrong when generating checksum?

thanks!

you have use

$wc.headers.add("x-checksum-sha1", $hash.tolower()) 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -