HEX
Server: Apache
System: Linux srv1.prosuiteplus.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: prosuiteplus (1001)
PHP: 8.3.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/pdfminer/__pycache__/ascii85.cpython-38.pyc
U

�R�]�@sLdZddlZddlZddlZdd�Ze�dej�Ze�dej�Zdd�Z	dS)	zi Python implementation of ASCII85/ASCIIHex decoder (Adobe version).

This code is in the public domain.

�NcCs�d}}d}t�|�D]�}t�|�}d|krr|dkrr|d7}|dt|�d}|dkr�|t�d	|�7}d}}q|d
kr�|dks�tt|���|d7}q|dkr|r�td|�D]}|dd
}q�|t�d	|�d|d�7}q�q|S)au
    In ASCII85 encoding, every four bytes are encoded with five ASCII
    letters, using 85 different types of characters (as 256**4 < 85**5).
    When the length of the original bytes is not a multiple of 4, a special
    rule is used for round up.

    The Adobe's ASCII85 implementation is slightly different from
    its original in handling the last characters.

    r��!�u��U�!�z>L�zs�~�TN)	�sixZ	iterbytes�int2byte�ord�structZpack�AssertionError�str�range)�data�n�b�out�i�c�_�r�2/usr/lib/python3/dist-packages/pdfminer/ascii85.py�
ascii85decodes(


rs([a-f\d]{2})s#^(?:[a-f\d]{2}|\s)*([a-f\d])[\s>]*$cCsPdd�}d}t�|�D]}|||�7}qt�|�}|rL|||�d�d�7}|S)a�
    ASCIIHexDecode filter: PDFReference v1.4 section 3.3.1
    For each pair of ASCII hexadecimal digits (0-9 and A-F or a-f), the
    ASCIIHexDecode filter produces one byte of binary data. All white-space
    characters are ignored. A right angle bracket character (>) indicates
    EOD. Any other characters will cause an error. If the filter encounters
    the EOD marker after reading an odd number of hexadecimal digits, it
    will behave as if a 0 followed the last digit.
    cSst|d�}t�|�S)N�)�intrr
)�xrrrr�decode?s
zasciihexdecode.<locals>.decoderr�0)�hex_re�findall�trail_re�search�group)rr rr�mrrr�asciihexdecode5s

r()
�__doc__�rerrr�compile�
IGNORECASEr"r$r(rrrr�<module>s!