View Full Version : سوال: يك تابع براي هش كردن MD5
  
navid heidarpour
چهارشنبه 09 بهمن 1387, 02:27 صبح
با سلام 
يك تابع براي هش كردن MD5 مي خواستم
اگر كسي چيزي داره واقعا ممنون ميشم
mostafaaa
چهارشنبه 09 بهمن 1387, 10:25 صبح
سلام دوست من
    Function getMd5Hash(ByVal input As String) As String
        ' Create a new instance of the MD5 object.
        Dim md5Hasher As MD5 = MD5.Create()
        ' Convert the input string to a byte array and compute the hash.
        Dim data As Byte() = md5Hasher.ComputeHash(Encoding.Default.GetBytes(in put))
        ' Create a new Stringbuilder to collect the bytes
        ' and create a string.
        Dim sBuilder As New StringBuilder()
        ' Loop through each byte of the hashed data 
        ' and format each one as a hexadecimal string.
        Dim i As Integer
        For i = 0 To data.Length - 1
            sBuilder.Append(data(i).ToString("x2"))
        Next i
        ' Return the hexadecimal string.
        Return sBuilder.ToString()
    End Function
abi_sarab
چهارشنبه 09 بهمن 1387, 18:43 عصر
می شه توضیح بدید Md5 چیه؟
mostafaaa
چهارشنبه 09 بهمن 1387, 18:55 عصر
سلام دوست من
http://www.barnamenevis.org/forum/showthread.php?t=10025
 
vBulletin® v4.2.5, Copyright ©2000-1404, Jelsoft Enterprises Ltd.