title: Progressive HMAC SHA256 in Objective-C
body: <p>I need to generate a hash using HMAC SHA256. I am using the following code in JavaScript. I need an equivalent code in Objective-C.</p>
  
  <pre><code>function serialize( obj ) {
     return Object.keys(obj).reduce(function(a,k){a.push(k+'='+encodeURIComponent(obj[k]));return a},[]).join('&amp;')
  }
  
  var query = {
    Action            : 'MyAction',
    SignatureMethod   : 'HmacSHA256',
  };
  
  var hmac = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, 'MYVALUE');
  var queryString = ['POST', 'm.service.it', '/api/v2', serialize(sorted)].join('\n');
  
  hmac.update(queryString);
  query.Signature = CryptoJS.enc.Base64.stringify(hmac.finalize());
  </code></pre>
  
  <p>How implement this in Objective-C?</p>