I have tried several cryptography classes on my app from System.Security.Crytogprahy MD5 being my original intention I have followed microsoft's example implementation to the line and yet my instance of md5 is always null.
Is there by any chance an issue with running this in iOS simulator for some reason or is it just my code?
public static string GenerateHashedPassword(string strPasswordToSave)
{
try
{
using (MD5 hasher = MD5.Create())
{
byte[] data = hasher.ComputeHash (Encoding.UTF8.GetBytes (strPasswordToSave));
StringBuilder sB = new StringBuilder ();
for (int i = 0; i < data.Length; i++)
{
sB.Append (data [i].ToString ("x2"));
}
Console.WriteLine (sB.ToString ());
return sB.ToString ();
}
}
catch(Exception e){Console.WriteLine (e.Message);}
return "";
}