From 08c5cc06c6ad9a1e0016ad89eb0f7ca009cc8108 Mon Sep 17 00:00:00 2001 From: Jon Hawkesworth Date: Thu, 11 Dec 2014 21:47:52 +0000 Subject: [PATCH] Switched to SHA1 checksum instead of MD5 --- windows/win_copy.ps1 | 12 ++++++------ windows/win_stat.ps1 | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/windows/win_copy.ps1 b/windows/win_copy.ps1 index 544187a8b5a..9ffdab85f03 100644 --- a/windows/win_copy.ps1 +++ b/windows/win_copy.ps1 @@ -52,17 +52,17 @@ if (Test-Path $dest -PathType Container) If (Test-Path $dest) { - $dest_md5 = Get-FileMd5 ($dest); - $src_md5 = Get-FileMd5 ($src); + $dest_checksum = Get-FileChecksum ($dest); + $src_checksum = Get-FileChecksum ($src); - If (! $src_md5.CompareTo($dest_md5)) + If (! $src_checksum.CompareTo($dest_checksum)) { # New-Item -Force creates subdirs for recursive copies New-Item -Force $dest -Type file; Copy-Item -Path $src -Destination $dest -Force; } - $dest_md5 = Get-FileMd5 ($dest); - If ( $src_md5.CompareTo($dest_md5)) + $dest_checksum = Get-FileChecksum ($dest); + If ( $src_checksum.CompareTo($dest_checksum)) { $result.changed = $TRUE; } @@ -78,7 +78,7 @@ Else $result.changed = $TRUE; } -$dest_checksum = Get-FileMd5($dest); +$dest_checksum = Get-FileChecksum($dest); $result.checksum = $dest_checksum; Exit-Json $result; diff --git a/windows/win_stat.ps1 b/windows/win_stat.ps1 index 928b779b488..10101a62b30 100644 --- a/windows/win_stat.ps1 +++ b/windows/win_stat.ps1 @@ -53,8 +53,9 @@ Else If ($get_md5 -and $result.stat.exists -and -not $result.stat.isdir) { - $hash = Get-FileMd5($path); + $hash = Get-FileChecksum($path); Set-Attr $result.stat "md5" $hash; + Set-Attr $result.stat "checksum" $hash; } Exit-Json $result;