• 68 Vote(s) - 2.59 Average
  • 1
  • 2
  • 3
  • 4
  • 5
الگوریتم sha برای دات نت
#1
Importarea :

Code:

Code:
Imports System.Security.Cryptography

Code:
Function getSHA1Hash(ByVal strToHash As String) As String
        Dim sha1Obj As New Security.Cryptography.SHA1CryptoServiceProvider
        Dim bytesToHash() As Byte = System.Text.Encoding.ASCII.GetBytes(strToHash)

        bytesToHash = sha1Obj.ComputeHash(bytesToHash)

        Dim strResult As String = ""

        For Each b As Byte In bytesToHash
            strResult += b.ToString("x2")
        Next

        Return strResult
    End Function

نحوه استفاده از تابع :

Code:
getSHA1Hash("text here")

گروه دور همی پارسی کدرز
https://t.me/joinchat/GxVRww3ykLynHFsdCvb7eg
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)