title: What is the difference between two implementations of the same key generator in PHP and Python?
body: <p>What is the difference between this implementation of auth key generator in PHP:</p>
  
  <pre><code>&lt;?php
  $password = "834ff7b651a6cb1b2f39c70bf43d3e78";
  $timestamp = round(microtime(true) * 1000);
  $hash = md5($password.$timestamp);
  echo "\n Timestamp: ".$timestamp;
  echo "\n Hash: ".$hash."\n";
  ?&gt;
  </code></pre>
  
  <p>and this one in python:</p>
  
  <pre><code>import hashlib
  import time
  import ipdb
  import math
  def microtime(get_as_float = False) :
      if get_as_float:
          return time.time()
      else:
          return '%f %d' % math.modf(time.time())
  
  password = "834ff7b651a6cb1b2f39c70bf43d3e78"
  timestamp = round(microtime(get_as_float=True)*1000)
  m = hashlib.md5()
  m.update(password + str(timestamp))
  hash = m.hexdigest()
  print(str(int(timestamp)))
  print(hash)
  </code></pre>
  
  <p>If the timestamp generation works in PHP in another way than my implementation in Python? </p>
  
  <p>Because I check it during the auth on the service which uses this timestamp in pair with hash calculated from password and timestamp concatenated together and in case with PHP I can pass, but in case with Python I cannot.</p>
  
  <p>Thanks!</p>