Added Tool-Function to get Sha1 from String elements

This commit is contained in:
Lord Hepipud 2019-09-10 09:38:35 +02:00
parent d3c6255896
commit f0b86ec346

View file

@ -0,0 +1,17 @@
function Get-StringSha1()
{
param(
[string]$Content
);
$CryptoAlgorithm = New-Object System.Security.Cryptography.SHA1CryptoServiceProvider;
$ContentHash = [System.Text.Encoding]::UTF8.GetBytes($Content);
$ContentBytes = $CryptoAlgorithm.ComputeHash($ContentHash);
$OutputHash = '';
foreach($byte in $ContentBytes) {
$OutputHash += $byte.ToString()
}
return $OutputHash;
}