2010年8月30日月曜日

md5変換


Public Function get_md5string(ByVal base)
Dim str As Byte() = System.Text.Encoding.ASCII.GetBytes(base)
Dim md5 As New System.Security.Cryptography.MD5CryptoServiceProvider()
Dim hash As Byte() = md5.ComputeHash(str)

'hexa変換
Dim res As String = BitConverter.ToString(hash).ToLower.Replace("-", "")

Return res
End Function

0 件のコメント:

コメントを投稿