Public/TMD.Hashing.ps1

function Get-StringHash {
    [CmdletBinding()]
    param(
        [CmdletBinding()]
        [Parameter(mandatory = $true, ValueFromPipeline = $true)]
        [String]
        $String
    )

    begin { }

    process {
        $md5 = New-Object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
        $utf8 = New-Object -TypeName System.Text.UTF8Encoding

        return [System.BitConverter]::ToString($md5.ComputeHash($utf8.GetBytes($String)))
    }

    end { }
}