You are on page 1of 1

vb.netcompute hash.

txt
sSourceData = "NotMySourceData"
tmpSource = ASCIIEncoding.ASCII.GetBytes(sSourceData)

Dim tmpNewHash() As Byte


Dim bEqual As Boolean = False
tmpNewHash = New MD5CryptoServiceProvider().ComputeHash(tmpSource)

If tmpNewHash.Length = tmpHash.Length Then


Dim i As Integer
Do While (i < tmpNewHash.Length) AndAlso (tmpNewHash(i) = tmpHash(i))
i += 1
Loop
If i = tmpNewHash.Length Then
bEqual = True
End If
End If

If bEqual Then
Console.WriteLine("The two hash values are the same")
Else
Console.WriteLine("The two hash values are not the same")
End If
Console.ReadLine()

Page 1

You might also like