danucalovj

Untitled

Jul 5th, 2012
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. Function getMD5Hash(ByVal strToHash As String) As String
  2. Dim md5Obj As New Security.Cryptography.MD5CryptoServiceProvider
  3. Dim bytesToHash() As Byte = System.Text.Encoding.ASCII.GetBytes(strToHash)
  4.  
  5. bytesToHash = md5Obj.ComputeHash(bytesToHash)
  6.  
  7. Dim strResult As String = ""
  8.  
  9. For Each b As Byte In bytesToHash
  10. strResult += b.ToString("x2")
  11. Next
  12.  
  13. Return strResult
  14. End Function
Advertisement
Add Comment
Please, Sign In to add comment