title: How to generate a unique ID which is time-like sortable?
body: <p>Is there a way to generate a universally unique ID that has always increasing values by the &quot;time&quot; it is generated? We can assume UTC timezone only for this problem.</p>
  <p>What I specifically mean with time-like sort-ability is:</p>
  <pre class="lang-py prettyprint-override"><code>from time import sleep
  
  id1 = generate_unique_id()
  sleep(1)
  
  id2 = generate_unique_id()
  sleep(1)
  
  id3 = generate_uniqueid()
  
  assert id1 &lt; id2
  assert id2 &lt; id3
  </code></pre>
  <p>So id1 could be <code>&quot;abcdefgh-ksfn-123&quot;</code>, id2 could be <code>&quot;abcdefgh-ksfn-231&quot;</code> etc.</p>
  <p>I do not really wish to use UTC timestamps directly as an ID since that does bear a bit of information I wish not to expose to the users with this ID. We can also assume that this ID will be generated concurrently, i.e. there is a chance that time parameters are identical for 2 separate executions (a tiny chance, but it is there), yet the ID should be different.</p>
  <p>Does anything like that exist already in Python/3rd party modules?
  If not what would be the best approach? Is it even possible to generate ID like this?</p>