0x1949 Team - FAZEMRX - MANAGER
Edit File: utils.cpython-310.pyc
o �7�b� � @ s� d dl Z d dlZd dlZd dlmZmZ zd dlmZ d dlm Z m Z W n ey/ eZY nw deee f de fdd�Zd eee f de fd d�Zd e de fdd �Zdede fdd�Zdeee f defdd�Zdedede fdd�Zde defdd�Zdede fdd�Zde dede fdd�Zd e dede fd!d"�Zh d#�Ze�d$d%�e� d& ej�Zd'e defd(d)�Zd*Z e�d+�Z!g d,�Z"d'e defd-d.�Z#dS )/� N)�Any�Union)� EllipticCurve)�decode_dss_signature�encode_dss_signature�value�returnc C s* t | t�r | �d�S t | t�r| S td��)Nzutf-8zExpected a string value)� isinstance�str�encode�bytes� TypeError)r � r �+/usr/lib/python3/dist-packages/jwt/utils.py�force_bytes s r �inputc C sB t | t�r | �d�} t| �d }|dkr| dd| 7 } t�| �S )N�ascii� r � =)r r r �len�base64�urlsafe_b64decode)r �remr r r �base64url_decode s r c C s t �| ��dd�S )Nr � )r �urlsafe_b64encode�replace)r r r r �base64url_encode% s r �valc C s0 | dk rt d��t| �}t|�dkrd}t|�S )Nr zMust be a positive integer� )� ValueError�bytes_from_intr r )r � int_bytesr r r �to_base64url_uint) s r# c C s* t | t�r | �d�} t| �}tj|dd�S )Nr �big)� byteorder)r r r r �int� from_bytes)r �datar r r �from_base64url_uint5 s r) �num� num_bytesc C s dd| | f }t �|�d��S )Nz%0*x� r )�binascii�a2b_hexr )r* r+ � padded_hexr r r �number_to_bytes= s r0 �stringc C s t t�| �d�S )N� )r&