diff --git a/lib/core/tools/Get-StringSha1.psm1 b/lib/core/tools/Get-StringSha1.psm1 new file mode 100644 index 0000000..cbaad28 --- /dev/null +++ b/lib/core/tools/Get-StringSha1.psm1 @@ -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; +}