code: def x5t_calculation(cert):
      
      if isinstance(cert, str):
          der_cert = base64.b64decode(cert.encode('ascii'))
      else:
          der_cert = base64.b64decode(cert)
  
      return b64e(hashlib.sha1(der_cert).digest())
docs: base64url-encoded SHA-1 thumbprint (a.k.a. digest) of the DER
      encoding of an X.509 certificate.
  
      :param cert: DER encoded X.509 certificate
      :return: x5t value