HMAC SHA1 Hash

Date: 2018-12-11
        public static string Encode(string input, byte[] key)
        {
            HMACSHA1 myhmacsha1 = new HMACSHA1(key);
            byte[] byteArray = Encoding.ASCII.GetBytes(input);
            MemoryStream stream = new MemoryStream(byteArray);
            return myhmacsha1.ComputeHash(stream).Aggregate("", (s, e) => s + String.Format("{0:x2}", e), s => s);
        }

Encode(user, Encoding.UTF8.GetBytes(secret));

 

16810cookie-checkHMAC SHA1 Hash