Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PowerShell text to MD5 hash
#converts string to MD5 hash in hyphenated and uppercase format
$someString = "test"
$md5 = new-object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
$utf8 = new-object -TypeName System.Text.UTF8Encoding
$hash = [System.BitConverter]::ToString($md5.ComputeHash($utf8.GetBytes($someString)))
#to remove hyphens and downcase letters add:
$hash = $hash.ToLower() -replace '-', ''
@karb0f0s

This comment has been minimized.

Copy link

commented Jan 18, 2018

Thanks!

@jamesmuldrow

This comment has been minimized.

Copy link

commented Feb 8, 2018

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.