code: def pex_hash(cls, d):
      
      names = sorted(f for f in cls._iter_files(d) if not (f.endswith('.pyc') or f.startswith('.')))
      def stream_factory(name):
        return open(os.path.join(d, name), 'rb')  # noqa: T802
      return cls._compute_hash(names, stream_factory)
docs: Return a reproducible hash of the contents of a directory.