{"id":1681,"date":"2018-12-11T16:02:30","date_gmt":"2018-12-11T15:02:30","guid":{"rendered":"https:\/\/solidt.eu\/site\/?p=1681"},"modified":"2018-12-11T16:02:30","modified_gmt":"2018-12-11T15:02:30","slug":"hmac-sha1-hash","status":"publish","type":"post","link":"https:\/\/solidt.eu\/site\/hmac-sha1-hash\/","title":{"rendered":"HMAC SHA1 Hash"},"content":{"rendered":"<pre class=\"lang:c# decode:true  \">        public static string Encode(string input, byte[] key)\r\n        {\r\n            HMACSHA1 myhmacsha1 = new HMACSHA1(key);\r\n            byte[] byteArray = Encoding.ASCII.GetBytes(input);\r\n            MemoryStream stream = new MemoryStream(byteArray);\r\n            return myhmacsha1.ComputeHash(stream).Aggregate(\"\", (s, e) =&gt; s + String.Format(\"{0:x2}\", e), s =&gt; s);\r\n        }\r\n\r\nEncode(user, Encoding.UTF8.GetBytes(secret));<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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(&#8220;&#8221;, (s, e) =&gt; s + String.Format(&#8220;{0:x2}&#8221;, e), s =&gt; s); } Encode(user, Encoding.UTF8.GetBytes(secret)); &nbsp;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[6],"tags":[],"class_list":["post-1681","post","type-post","status-publish","format-standard","hentry","category-dotnet"],"_links":{"self":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts\/1681","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/comments?post=1681"}],"version-history":[{"count":1,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts\/1681\/revisions"}],"predecessor-version":[{"id":1682,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts\/1681\/revisions\/1682"}],"wp:attachment":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/media?parent=1681"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/categories?post=1681"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/tags?post=1681"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}