Created
April 5, 2017 11:16
-
-
Save serkanberksoy/cebdb300143996a16a5bbd42936796c2 to your computer and use it in GitHub Desktop.
C# MD5 Generator same as JavaScript
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
// Working C# equivalent | |
public static string GetMD5Working(string input) | |
{ | |
MD5 md5 = MD5.Create(); | |
byte[] hash = md5.ComputeHash(Encoding.UTF8.GetBytes(input)); | |
StringBuilder sb = new StringBuilder(); | |
for (int j = 0; j < hash.Length; j++) | |
{ | |
sb.Append(hash[j].ToString("X2")); | |
} | |
return sb.ToString().ToLower(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment