Posted By

ptruta on 04/30/10


Net hash md5 vb

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


VB.NET md5 Hash

 / Published in: VB.NET


  1. Public Function MD5(ByVal str As String) As String
  2. Dim ASCIIenc As New ASCIIEncoding
  3. Dim strReturn
  4. Dim ByteSource() As Byte = ASCIIenc.GetBytes(str)
  5. Dim Md5Hash As New MD5CryptoServiceProvider
  6. Dim ByteHash() As Byte = Md5Hash.ComputeHash(ByteSource)
  7. For Each b As Byte In ByteHash
  8. strReturn &= b.ToString("x2")
  9. Next
  10. Return strReturn
  11. End Function

Report this snippet  

You need to login to post a comment.