Imports System.Security.Cryptography
Dim input As String = "hello world"
Console.WriteLine(md5hash(input))
Public Function md5hash(txt As String)
Dim md5 As New MD5CryptoServiceProvider()
Dim hash AS Byte() = md5.ComputeHash(ASCIIEncoding.ASCII.GetBytes(txt))
Dim result As New StringBuilder()
For i As Integer = 0 To 9
If i Mod 2 = 0 AndAlso i > 0 Then result.Append("-"c)
result.Append(hash(i).ToString("X2"))