
    ;3h                     l    d Z ddlZddlmZ ddlmZ dedefdZ ej                  d      Z	dedefd	Z
y)
zBPython implementation of ASCII85/ASCIIHex decoder (Adobe version).    N)	a85decode)	unhexlifydatareturnc                 R    	 t        | d      S # t        $ r t        |       cY S w xY 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   s    P/var/www/html/audio-gradio/venv/lib/python3.12/site-packages/pdfminer/ascii85.pyascii85decoder      s-    T** s    &&s   \sc                     t         j                  d|       } | j                  d      }|dk7  r| d| } |dz  dk(  r| dz  } 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   idxs     r
   asciihexdecoder      sQ     ::c4 D
))D/C
byDSz7a<DLDT?r   )__doc__rebase64r   binasciir   bytesr   compiler   r    r   r
   <module>r      sI    H 	   %   
F	 5 r   