MD5 or SHA1

How to get MD5 or SHA1 hash with JavaScript on Windows Phone 8?

Try using UnityEngine.Windows.Crypto

I use this code:

var bytes = System.Text.Encoding.UTF8.GetBytes("test");
var hash = Windows.Crypto.ComputeMD5Hash(bytes);
print(System.Text.Encoding.UTF8.GetString(hash));

MD5 hash for this string should be 098f6bcd4621d373cade4e832627b4f6, but I got something like \t\xef\xbf\xbdk\xbf.... How to fix this?

Something like this:

		var hash = Crypto.ComputeMD5Hash(bytes);

		string t = "";
		for (int i = 0; i < hash.Length; i++)
			t += string.Format("{0:x2}", hash[i]);

Thank you very much.