I am struggling to create an MD5 hash in VFP and I can then compare to a hash in .Net.
I am using VFPEncryption.FLL to generate a MD5Hash that I then STRCONV (hashResult,15) and send to my .Net web service.
In .Net I am using:
MD5 md5 = new MD5CryptoServiceProvider();
var result = md5.ComputeHash(bytes);
var SB = new StringBuilder();
var sb = new StringBuilder();
for (var i = 0; i < result.Length; i++)
{
sb.Append(result[i].ToString("X2"));
SB.Append(result[i].ToString("x2"));
}
return sb.ToString();
But the results are never equal.
I have compared the input to both functions and they are equal.
Am I taking the wrong approach?
Any insight you could provide would be greatly appreciated.