0

Possible Duplicate:
How to generate MD5 hash code for my WinRT app using C#?

I am developing a metro style app using c# and xaml. In my application i want to create a signature by hashing the API key and Secret Key together using the MD5 algorithm.How it is possible to hashing the API key and Secret Key using MD5 algorithm. Please help me

Community
  • 1
  • 1
Aneesh
  • 53
  • 1
  • 6
  • This might help http://stackoverflow.com/questions/8299142/how-to-generate-md5-hash-code-for-my-winrt-app-using-c – RobH Oct 25 '12 at 13:54

1 Answers1

0

Consider this code snipped, you can go for something like this, assuming yourString is your API Key + Secret Key concatained.

public string Foo(string yourString)
{
    using(var md5HashProvider = new MD5CryptoServiceProvider())
    {
        byte[] hash = md5HashProvider.ComputeHash(utf8.GetBytes(yourString));
        return Convert.ToBase64String(hash);
    }
}
graph1ZzLle
  • 259
  • 2
  • 9