Imports System.Security.Cryptography
Imports System.Text
Public Function GeraHash(ByVal sTexto As String) As String
Dim sSenha As String
Dim SHA1hashValue() As Byte
Dim b As Byte
Dim UE As New UnicodeEncoding
Dim MessageBytes As Byte() = UE.GetBytes(sTexto)
Dim SHHash As New SHA1Managed
SHA1hashValue = SHHash.ComputeHash(MessageBytes)
sSenha = ""
For Each b In SHA1hashValue
sSenha &= b
Next
Return sSenha
End Function
Nenhum comentário:
Postar um comentário