code: def _hostname_matches(self, hostname, entry):
          
          for h in entry.hostnames:
              if (
                  h == hostname
                  or h.startswith("|1|")
                  and not hostname.startswith("|1|")
                  and constant_time_bytes_eq(self.hash_host(hostname, h), h)
              ):
                  return True
          return False
docs: Tests whether ``hostname`` string matches given SubDict ``entry``.
  
          :returns bool: