aboutsummaryrefslogtreecommitdiff
path: root/scripts/VcpkgPowershellUtils.ps1
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2018-04-04 20:07:45 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2018-04-06 17:24:46 -0700
commit2fa16cda18856ae7f6685c48c0aeefd15225af11 (patch)
treeb9435c15e40fa11317ee93abfdb3f6ef65da2f0c /scripts/VcpkgPowershellUtils.ps1
parentda9d1c46750bf78db65383e3a48d71905b8f91ef (diff)
downloadvcpkg-2fa16cda18856ae7f6685c48c0aeefd15225af11.tar.gz
vcpkg-2fa16cda18856ae7f6685c48c0aeefd15225af11.zip
[vcpkgTools.xml] Change sha256 to sha512
Diffstat (limited to 'scripts/VcpkgPowershellUtils.ps1')
-rw-r--r--scripts/VcpkgPowershellUtils.ps18
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1
index d7967889e..676ee5c03 100644
--- a/scripts/VcpkgPowershellUtils.ps1
+++ b/scripts/VcpkgPowershellUtils.ps1
@@ -79,22 +79,22 @@ function vcpkgGetCredentials()
}
}
-function vcpkgGetSHA256([Parameter(Mandatory=$true)][string]$filePath)
+function vcpkgGetSHA512([Parameter(Mandatory=$true)][string]$filePath)
{
if (vcpkgHasCommand -commandName 'Microsoft.PowerShell.Utility\Get-FileHash')
{
Write-Verbose("Hashing with Microsoft.PowerShell.Utility\Get-FileHash")
- $hash = (Microsoft.PowerShell.Utility\Get-FileHash -Path $filePath -Algorithm SHA256).Hash
+ $hash = (Microsoft.PowerShell.Utility\Get-FileHash -Path $filePath -Algorithm SHA512).Hash
}
elseif(vcpkgHasCommand -commandName 'Pscx\Get-Hash')
{
Write-Verbose("Hashing with Pscx\Get-Hash")
- $hash = (Pscx\Get-Hash -Path $filePath -Algorithm SHA256).HashString
+ $hash = (Pscx\Get-Hash -Path $filePath -Algorithm SHA512).HashString
}
else
{
Write-Verbose("Hashing with .NET")
- $hashAlgorithm = [Security.Cryptography.HashAlgorithm]::Create("SHA256")
+ $hashAlgorithm = [Security.Cryptography.HashAlgorithm]::Create("SHA512")
$fileAsByteArray = [io.File]::ReadAllBytes($filePath)
$hashByteArray = $hashAlgorithm.ComputeHash($fileAsByteArray)
$hash = -Join ($hashByteArray | ForEach-Object {"{0:x2}" -f $_})