C# Equivalent of PHP's raw output MD5?
raw output means actual bytes, you don't need to convert them into base16 string:
public static byte[] Md5Sum_Raw(string strToEncrypt){ System.Text.UTF8Encoding ue = new System.Text.UTF8Encoding(); byte[] bytes = ue.GetBytes(strToEncrypt); // encrypt bytes MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider(); return md5.ComputeHash(bytes);}
PHP:
$s = md5('1234567890', true);for ($i=0; $i < strlen($s); $i++) echo ord($s[$i]) . ' ';
232 7 241 252 248 45 19 47 155 176 24 202 103 56 161 159
C#:
byte[] hash = Md5Sum_Raw("1234567890");for (int i = 0; i < hash.Length; i++) System.Console.Out.Write(hash[i] + " ");System.Console.Out.WriteLine();232 7 241 252 248 45 19 47 155 176 24 202 103 56 161 159