Files
netch/sha256.ps1
Connection Refused 5970e30974 m
2021-04-02 01:34:56 +08:00

6 lines
259 B
PowerShell

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()