Created
March 28, 2017 07:18
-
-
Save WalternativE/450b155c45f81b14290f8ded8324a283 to your computer and use it in GitHub Desktop.
Powershell script that returns SHA-256 hash for a given string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param ( | |
[Parameter(Mandatory=$true)] | |
[string] | |
$ClearString | |
) | |
$hasher = [System.Security.Cryptography.HashAlgorithm]::Create('sha256') | |
$hash = $hasher.ComputeHash([System.Text.Encoding]::UTF8.GetBytes($ClearString)) | |
$hashString = [System.BitConverter]::ToString($hash) | |
$hashString.Replace('-', '') |
Thank you - very cool! saved me much time!
Glad that it helped you 😊
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you - very cool! saved me much time!