H
HamuNaptra
Hi im trying to get a hash from a string and conert it back to a string
eg. "test" = "098f6bcd4621d373cade4e832627b4f6"
my function:
Private Function GenerateHash(ByVal SourceText As String) As String
Dim Ue As New UnicodeEncoding()
Dim ByteSourceText() As Byte = Ue.GetBytes(SourceText)
Dim Md5 As New MD5CryptoServiceProvider()
Dim ByteHash() As Byte = Md5.ComputeHash(ByteSourceText)
Return Encoding.ASCII.GetString(ByteHash)
End Function
when i call the function i get this:
"yAWeLsdBn1kOedfxt3S/5g=="
eg. "test" = "098f6bcd4621d373cade4e832627b4f6"
my function:
Private Function GenerateHash(ByVal SourceText As String) As String
Dim Ue As New UnicodeEncoding()
Dim ByteSourceText() As Byte = Ue.GetBytes(SourceText)
Dim Md5 As New MD5CryptoServiceProvider()
Dim ByteHash() As Byte = Md5.ComputeHash(ByteSourceText)
Return Encoding.ASCII.GetString(ByteHash)
End Function
when i call the function i get this:
"yAWeLsdBn1kOedfxt3S/5g=="