Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/site-packages/rsa/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/site-packages/rsa/__pycache__/transform.cpython-38.pyc
U

O��g��@sLdZddlZeed�dd�Zd
eeed�dd�Zed	krHddlZe��dS)zNData transformation functions.

From bytes to a number, number to bytes, etc.
�N)�	raw_bytes�returncCstj|ddd�S)z�Converts a list of bytes or an 8-bit string to an integer.

    When using unicode strings, encode it to some encoding like UTF8 first.

    >>> (((128 * 256) + 64) * 256) + 15
    8405007
    >>> bytes2int(b'\x80@\x0f')
    8405007

    �bigF)�signed)�int�
from_bytes)r�r�:/opt/cppython/lib/python3.8/site-packages/rsa/transform.py�	bytes2intsr
)�number�	fill_sizercCsL|dkrtd|��tdt�|��d��}|dkr@|�|d�S|�|d�S)a�
    Convert an unsigned integer to bytes (big-endian)::

    Does not preserve leading zeros if you don't specify a fill size.

    :param number:
        Integer value
    :param fill_size:
        If the optional fill size is given the length of the resulting
        byte string is expected to be the fill size and will be padded
        with prefix zero bytes to satisfy that length.
    :returns:
        Raw bytes (base-256 representation).
    :raises:
        ``OverflowError`` when fill_size is given and the number takes up more
        bytes than fit into the block. This requires the ``overflow``
        argument to this function to be set to ``False`` otherwise, no
        error will be raised.
    rz&Number must be an unsigned integer: %d��r)�
ValueError�max�math�ceil�
bit_length�to_bytes)rrZbytes_requiredrrr	�	int2bytes%sr�__main__)r)	�__doc__r�bytesrr
r�__name__�doctest�testmodrrrr	�<module>s 

F1le Man4ger