hungvb

MD5 encryption VB.NET

Nov 20th, 2021
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.49 KB | None | 0 0
  1. Public Function encryptData(ByVal data As String) As Byte()
  2.         Dim md5Hasher As New System.Security.Cryptography.MD5CryptoServiceProvider()
  3.         Dim hashedBytes As Byte()
  4.         Dim encoder As New System.Text.UTF8Encoding()
  5.         hashedBytes = md5Hasher.ComputeHash(encoder.GetBytes(data))
  6.         Return hashedBytes
  7. End Function
  8.  
  9. Public Function md5(ByVal data As String) As String
  10.         Return BitConverter.ToString(encryptData(data)).Replace("-", "").ToLower()
  11. End Function
Advertisement
Add Comment
Please, Sign In to add comment