The value returned by HashData is not a Md5 hash example:
Hashing the "a" always return "0cc175b9c0f1b6a831c399e269772661"
But this code always returns a different value.
private byte[] GetHash(string data)
{
IHashAlgorithmProvider algoProv = HashAlgorithmProvider.OpenAlgorithm(HashAlgorithm.Md5);
byte [] dataTB = Encoding.UTF8.GetBytes(data);
return algoProv.HashData(dataTB);
}
I've tested the
MD5algorithm fromPCLCryptoand it worked as expected. Always printed "0cc175b9c0f1b6a831c399e269772661"