Skip to content

Instantly share code, notes, and snippets.

@WalternativE
Created March 28, 2017 07:18
  • Star 14 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Powershell script that returns SHA-256 hash for a given string
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('-', '')
@DerrickAttfield
Copy link

Thank you - very cool! saved me much time!

@WalternativE
Copy link
Author

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