Last active
December 11, 2021 23:38
-
-
Save ardislu/1e258716c71c4712b693f17a0dc57180 to your computer and use it in GitHub Desktop.
Powershell script to hash a string.
This file contains hidden or 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
# December 2021 update: this gist is not maintained. | |
# View the latest version of this function in my module: https://github.com/ardislu/ArdisUtilities | |
Param( | |
[string]$Value = '', | |
[string]$Algorithm = 'SHA1' | |
) | |
$stream = [System.IO.MemoryStream]::new([byte[]][char[]]$Value) | |
Get-FileHash -InputStream $stream -Algorithm $Algorithm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment