code: def generate_identity(self):
          
          identity = struct.pack('!BI', 0, self._base_identity)
          self._base_identity += 1
  
          if self._base_identity >= 2 ** 32:
              self._base_identity = 0
  
          return identity
docs: Generate a unique but random identity.