Created
June 20, 2011 16:22
-
-
Save RobertMischke/1035924 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Class HashLogin | |
Public Shared Function Run(email As String, salt As String) As String | |
Dim md5Hasher As MD5 = MD5.Create() | |
Dim data As Byte() = md5Hasher.ComputeHash(Encoding.[Default].GetBytes(password & salt)) | |
Dim stringBuilder = New StringBuilder() | |
For i As Integer = 0 To data.Length - 1 | |
stringBuilder.Append(data(i).ToString("x2")) | |
Next | |
Return stringBuilder.ToString() | |
End Function | |
End Class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
IHashing weil ich wohl verschiedenen Hasher einbauen muss, wegen Rückwärtskompabilität.
Desweiteren ist es einfacher ein IHashing mit Hashing zu registrieren (per Konvention) als bestimmte Klassen einzeln zu registrieren. Deshalb Interfacerities ;)