HEX
Server: LiteSpeed
System: Linux server.nevid-deploma.com 4.18.0-553.111.1.lve.el8.x86_64 #1 SMP Fri Mar 13 13:42:17 UTC 2026 x86_64
User: smilepac (1037)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/cppython/lib/python3.8/site-packages/oauth2client/__pycache__/_pkce.cpython-38.pyc
U

KD�g��@s2dZddlZddlZddlZddd�Zdd�ZdS)	zm
Utility functions for implementing Proof Key for Code Exchange (PKCE) by OAuth
Public Clients

See RFC7636.
�N�@cCsJt�t�|���d�}t|�dkr,td��nt|�dkrBtd��n|SdS)a�
    Generates a 'code_verifier' as described in section 4.1 of RFC 7636.

    This is a 'high-entropy cryptographic random string' that will be
    impractical for an attacker to guess.

    Args:
        n_bytes: integer between 31 and 96, inclusive. default: 64
            number of bytes of entropy to include in verifier.

    Returns:
        Bytestring, representing urlsafe base64-encoded random data.
    �=�+z)Verifier too short. n_bytes must be > 30.�z(Verifier too long. n_bytes must be < 97.N)�base64�urlsafe_b64encode�os�urandom�rstrip�len�
ValueError)Zn_bytes�verifier�r�?/opt/cppython/lib/python3.8/site-packages/oauth2client/_pkce.py�
code_verifiers

rcCst�|���}t�|��d�S)a�
    Creates a 'code_challenge' as described in section 4.2 of RFC 7636
    by taking the sha256 hash of the verifier and then urlsafe
    base64-encoding it.

    Args:
        verifier: bytestring, representing a code_verifier as generated by
            code_verifier().

    Returns:
        Bytestring, representing a urlsafe base64-encoded sha256 hash digest,
            without '=' padding.
    r)�hashlib�sha256�digestrrr
)r
rrrr�code_challenge4sr)r)�__doc__rrrrrrrrr�<module>s