o
    éT•jä  ã                   @   s’   d Z ddlZddlZddd„Zddd„ZG dd	„ d	ejƒZG d
d„ dejƒZG dd„ dejƒZG dd„ deejƒZG dd„ deej	ƒZ	dd„ Z
dS )z Python 'hex_codec' Codec - 2-digit hex content transfer encoding.

This codec de/encodes from bytes to bytes.

Written by Marc-Andre Lemburg (mal@lemburg.com).
é    NÚstrictc                 C   ó   |dksJ ‚t  | ¡t| ƒfS ©Nr   )ÚbinasciiÚb2a_hexÚlen©ÚinputÚerrors© r   ú*/usr/lib/python3.10/encodings/hex_codec.pyÚ
hex_encode   ó   r   c                 C   r   r   )r   Úa2b_hexr   r   r   r   r   Ú
hex_decode   r   r   c                   @   s    e Zd Zddd„Zddd„ZdS )ÚCodecr   c                 C   ó
   t ||ƒS ©N)r   ©Úselfr	   r
   r   r   r   Úencode   ó   
zCodec.encodec                 C   r   r   )r   r   r   r   r   Údecode   r   zCodec.decodeN©r   )Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r      s    
r   c                   @   ó   e Zd Zddd„ZdS )ÚIncrementalEncoderFc                 C   ó   | j dksJ ‚t |¡S r   )r
   r   r   ©r   r	   Úfinalr   r   r   r      ó   
zIncrementalEncoder.encodeN©F)r   r   r   r   r   r   r   r   r      ó    r   c                   @   r   )ÚIncrementalDecoderFc                 C   r   r   )r
   r   r   r    r   r   r   r   !   r"   zIncrementalDecoder.decodeNr#   )r   r   r   r   r   r   r   r   r%       r$   r%   c                   @   ó   e Zd ZeZdS )ÚStreamWriterN©r   r   r   ÚbytesÚcharbuffertyper   r   r   r   r'   %   ó    r'   c                   @   r&   )ÚStreamReaderNr(   r   r   r   r   r,   (   r+   r,   c                
   C   s   t jdttttttdd�S )NÚhexF)Únamer   r   ÚincrementalencoderÚincrementaldecoderÚstreamwriterÚstreamreaderÚ_is_text_encoding)ÚcodecsÚ	CodecInfor   r   r   r%   r'   r,   r   r   r   r   Úgetregentry-   s   ør6   r   )Ú__doc__r4   r   r   r   r   r   r%   r'   r,   r6   r   r   r   r   Ú<module>   s    

