Apologies. Never thought about  visiting the link from mobile.<p>Here is the algorithm that i copied from angularjs website as it is:<p><pre><code>   myApp.factory(&#x27;apiToken&#x27;, [&#x27;clientId&#x27;, function apiTokenFactory(clientId) {
  var encrypt = function(data1, data2) {
    &#x2F;&#x2F; NSA-proof encryption algorithm:
    return (data1 + &#x27;:&#x27; + data2).toUpperCase();
  };

  var secret = window.localStorage.getItem(&#x27;myApp.secret&#x27;);
  var apiToken = encrypt(clientId, secret);

  return apiToken;</code></pre>
}]);