Update sha256.ps1

This commit is contained in:
Bruce Wayne
2021-05-14 10:16:11 +08:00
committed by GitHub
parent 764d42efe2
commit ebe2978724

View File

@@ -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()
(Get-FileHash $file -Algorithm SHA256).Hash.ToLower()