PowerShell - SHA256ハッシュ値文字列の取得
function getSHA256Hash( [string]$s ){ $sha256 = New-Object System.Security.Cryptography.SHA256Managed $utf8 = New-Object System.Text.UTF8Encoding $h = $sha256.ComputeHash( $utf8.GetBytes($s) ) return ($h | %{$_.ToString("x2")}) -join "" } Write-Host $(getSHA256Hash "") # 空文字 # e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 Write-Host $(getSHA256Hash "あ") # dc5a4d3d82f7e15792959dc661538ae0e541ce66494516f5c9cfd9cd3308494d