From ebe2978724e7bd0120f57432736cb3b233733ccc Mon Sep 17 00:00:00 2001 From: Bruce Wayne Date: Fri, 14 May 2021 10:16:11 +0800 Subject: [PATCH] Update sha256.ps1 --- sha256.ps1 | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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()