
    ,h                         d Z ddlZddlZddlZd Z ej
                  dej                        Z ej
                  dej                        Zd Z	y)zi Python implementation of ASCII85/ASCIIHex decoder (Adobe version).

This code is in the public domain.

    Nc                    dx}}d}t        j                  |       D ]  }t        j                  |      }d|k  rB|dk  r=|dz  }|dz  t        |      dz
  z   }|dk(  sA|t	        j
                  d	|      z  }dx}}_|d
k(  r|dk(  sJ t        |             |dz  }|dk(  s|r:t        d|z
        D ]
  }|dz  dz   } |t	        j
                  d	|      d|dz
   z  } |S  |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          ~T   N)six	iterbytesint2byteordstructpackstrrange)datanboutic_s          R/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/pdfminer/ascii85.pyascii85decoder      s	    IA
C]]4  
,,q/19dFA"c!fRi AAvv{{4++	A$Y6!3q6!;C$Yqs  A"RA v{{4+DQqS11J#" Jr   s   ([a-f\d]{2})s#   ^(?:[a-f\d]{2}|\s)*([a-f\d])[\s>]*$c                     d }d}t         j                  |       D ]  }| ||      z  } t        j                  |       }|r| ||j	                  d      dz         z  }|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.
    c                 D    t        | d      }t        j                  |      S )N   )intr   r   )xr   s     r   decodezasciihexdecode.<locals>.decode?   s    
a)||Ar   r   r      0)hex_refindalltrail_researchgroup)r   r$   r   r#   ms        r   asciihexdecoder,   5   sf     	C^^D! VAY 	AVAGGAJtO$$Jr   )
__doc__rer   r   r   compile
IGNORECASEr&   r(   r,    r   r   <module>r2      sO    
  
B 
OR]]	32::<bmmLr   