diff --git a/sha256.ps1 b/sha256.ps1 index a85c0ba8..72501825 100644 --- a/sha256.ps1 +++ b/sha256.ps1 @@ -1,6 +1,2 @@ param([string]$file) -$hash = [Security.Cryptography.HashAlgorithm]::Create( "SHA256" ) -$path = (Resolve-Path -Path $file).Path -$stream = ([IO.StreamReader]$path).BaseStream --join ($hash.ComputeHash($stream) | ForEach-Object { "{0:x2}" -f $_ }) -$stream.Close() \ No newline at end of file +(Get-FileHash $file -Algorithm SHA256).Hash.ToLower()