o
    h                     @   sV   d Z ddlZddlmZ ddlmZ dedefddZed	Z	dedefd
dZ
dS )zBPython implementation of ASCII85/ASCIIHex decoder (Adobe version).    N)	a85decode)	unhexlifydatareturnc                 C   s*   zt | ddW S  ty   t |  Y S w )ap  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.

    T)adobe)r   
ValueError)r    r   C/var/www/html/venv/lib/python3.10/site-packages/pdfminer/ascii85.pyascii85decode   s
   
r
   s   \sc                 C   sF   t d| } | d}|dkr| d| } |d dkr| d7 } t| 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.
           >N         0)bws_resubfindr   )r   idxr   r   r	   asciihexdecode   s   	
r   )__doc__rebase64r   binasciir   bytesr
   compiler   r   r   r   r   r	   <module>   s    
