title: Hash 512 gives different results in Python than with PHP
body: <p>I'm trying to connect to the Shopwedo API in Python. <a href="https://admin.shopwedo.com/developer/" rel="nofollow noreferrer">https://admin.shopwedo.com/developer/</a>.</p>
  
  <p>Everything works well except the hashing.
  Below, are sample scripts in PHP and in Python. The hashing of the same string returns a different final result.</p>
  
  <p><strong>PHP CODE</strong></p>
  
  <pre><code>/** * Prepare credentials: */ 
  $credentials = array(    
   'id' =&gt; 1234,     
  'key' =&gt; "HelloTest",     
  'timestamp' =&gt; 1554888606,    
   'salt' =&gt; 'diego' );
  
  /** * Generate token by combining credentials: */ 
  $hash_preparation = implode('', array_values($credentials));
  $token = hash_hmac('sha512', $hash_preparation, '');
  
  print($token);
  </code></pre>
  
  <p>This PHP code returns: </p>
  
  <pre><code>b0d45466aa68db7df247d858094f88010b7c58820538309fff
  e28a42458a6ce4b6b2d48b1c5b9d40492851db075af9d86b2e
  1c81c4a6960d3dfb4616bccb617a
  </code></pre>
  
  <p><strong>PYTHON CODE</strong></p>
  
  <pre><code>import hashlib
  
  params={'shopid':1234,
          'apikey': "HelloTest",
          'timestamp':1554888606,
          'salt': "diego"}
  
  tosign = "".join([str(params[i]) for i in params] )
  token = hashlib.sha512(tosign.encode()).hexdigest()
  
  print(token)
  </code></pre>
  
  <p>This Python code returns: </p>
  
  <pre><code>34480ef855ff09d743ff5931ff39851ee4031e470c0fddb7e7
  ba6a1c9a8a5145bfbcd020c11220287f2747f28f48d77893ff
  f4f8dcce82ab54e70c67f172bab9
  </code></pre>