VB md5

Public Function Md5(ByVal code As String)
          Dim _md5 As String = ""
          Dim dataToHash As Byte() = (New System.Text.ASCIIEncoding).GetBytes(code)
          Dim hashvalue As Byte() = CType(System.Security.Cryptography.CryptoConfig.CreateFromName("MD5"), System.Security.Cryptography.HashAlgorithm).ComputeHash(dataToHash)
          Dim i As Integer
          For i = 0 To 15 '选择32位字符的加密结果
              _md5 += Hex(hashvalue(i)).ToLower
          Next
          Return _md5
End Function

发表评论

邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据