def code_challenge(verifier):
 digest = hashlib.sha256(verifier).digest()
 return base64.urlsafe_b64encode(digest).rstrip('=')

def code_challenge ( verifier ) : digest = hashlib . sha256 ( verifier ) . digest ( ) return base64 . urlsafe_b64encode ( digest ) . rstrip ( '=' )
creates a code_challenge as described in section 4 .