def randomish_uid():
 with RID_COUNTER_LOCK:
  global RID_COUNTER
  RID_COUNTER += 1
  RID_COUNTER %= 4096
  return ('%3.3x%7.7x%x' % (random.randint(0, 4095), (time.time() // 16), RID_COUNTER))

def randomish_uid ( ) : with RID_COUNTER_LOCK : global RID_COUNTER RID_COUNTER += 1 RID_COUNTER %= 4096 return ( '%3.3x%7.7x%x' % ( random . randint ( 0 , 4095 ) , ( time . time ( ) // 16 ) , RID_COUNTER ) )
generate a weakly random unique id .