CryptoTest

CSharp · Console

/Program.cs

using System;
using System.Web;
					
public class Program
{

	public static void Main()
	{

		byte[] key = Convert.FromBase64String("loQj47u9A5Vj6slaKmCShd/wg2hS+Mn5mM2s5NT5GzF3um1WsbFan8y7cxDVEai8ETG5hZ+CqPDrRBJ/V0yRFA==");
		Console.WriteLine(BitConverter.ToString(key));
		
        byte[] data = System.Text.Encoding.UTF8.GetBytes("9644873");
        byte[] mac = null;

        using (System.Security.Cryptography.HMACSHA256 hmac = new System.Security.Cryptography.HMACSHA256(key))
        {
            mac = hmac.ComputeHash(data);
        }
		
		Console.WriteLine(BitConverter.ToString(mac));
		
		var test = HttpServerUtility.UrlTokenEncode(mac);
		Console.WriteLine(test);

	}
}
;