Public Function pwdMd5Hash(ByVal String2Hash As String) As String Try Dim MD5Hasher As New System.Security.Cryptography.MD5CryptoServiceProvider() Dim oEncoder As New System.Text.ASCIIEncoding() Dim bytes As Byte() = oEncoder.GetBytes(String2Hash) Dim myHash As Byte() = MD5Hasher.ComputeHash(bytes) Dim myCapacity As Integer = 7 Dim sb As System.Text.StringBuilder = New System.Text.StringBuilder(myCapacity) Dim I As Integer For I = 0 To myHash.Length - 1 sb.Append(BitConverter.ToString(myHash, I, 1)) Next I Return sb.ToString().TrimEnd(New Char() {" "c}) Catch ex As Exception Return "0" End Try
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)