Imports System.Security.Cryptography

 

Public Function Md5hash_String(ByVal InputString As String) As String
Dim code, MD5
Dim dataToHash As Byte() = (New System.Text.ASCIIEncoding).GetBytes(InputString)
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
arrow
arrow
    全站熱搜

    戮克 發表在 痞客邦 留言(0) 人氣()