code: def unique_id(length=12, increment=0):
      
      # head the identifier with 16 bits of time information
      # this provides locality and reduces collision chances
      head = np.array((increment + time.time() * 10) % 2**16,
                      dtype=np.uint16).tostring()
      # get a bunch of random bytes
      random = np.random.random(int(np.ceil(length / 5))).tostring()
      # encode the time header and random information as base64
      # replace + and / with spaces
      unique = base64.b64encode(head + random,
                                b'  ').decode('utf-8')
      # remove spaces and cut to length
      unique = unique.replace(' ', '')[:length]
      return unique
docs: Generate a decent looking alphanumeric unique identifier.
      First 16 bits are time- incrementing, followed by randomness.
  
      This function is used as a nicer looking alternative to:
      >>> uuid.uuid4().hex
  
      Follows the advice in:
      https://eager.io/blog/how-long-does-an-id-need-to-be/
  
      Parameters
      ------------
      length:    int, length of resulting identifier
      increment: int, number to add to header uint16
                      useful if calling this function repeatedly
                      in a tight loop executing faster than time
                      can increment the header
      Returns
      ------------
      unique: str, unique alphanumeric identifier