code: def thumbprint(self, hash_function, members=None):
          
          if members is None:
              members = self.required
  
          members.sort()
          ser = self.serialize()
          _se = []
          for elem in members:
              try:
                  _val = ser[elem]
              except KeyError:  # should never happen with the required set
                  pass
              else:
                  if isinstance(_val, bytes):
                      _val = as_unicode(_val)
                  _se.append('"{}":{}'.format(elem, json.dumps(_val)))
          _json = '{{{}}}'.format(','.join(_se))
  
          return b64e(DIGEST_HASH[hash_function](_json))
docs: Create a thumbprint of the key following the outline in
          https://tools.ietf.org/html/draft-jones-jose-jwk-thumbprint-01
  
          :param hash_function: A hash function to use for hashing the
              information
          :param members: Which attributes of the Key instance that should
              be included when computing the hash value. If members is undefined
              then all the required attributes are used.
          :return: A base64 encode hash over a set of Key attributes