3
4^^                 @   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 )zPython '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   s   |dkst tj| t| fS )Nr   )AssertionErrorbinasciib2a_hexlen)inputerrors r	   )/usr/lib/python3.6/encodings/hex_codec.py
hex_encode   s    r   c             C   s   |dkst tj| t| fS )Nr   )r   r   a2b_hexr   )r   r   r	   r	   r
   
hex_decode   s    r   c               @   s    e Zd ZdddZdddZdS )	Codecr   c             C   s
   t ||S )N)r   )selfr   r   r	   r	   r
   encode   s    zCodec.encodec             C   s
   t ||S )N)r   )r   r   r   r	   r	   r
   decode   s    zCodec.decodeN)r   )r   )__name__
__module____qualname__r   r   r	   r	   r	   r
   r      s   
r   c               @   s   e Zd ZdddZdS )IncrementalEncoderFc             C   s   | j dksttj|S )Nr   )r   r   r   r   )r   r   finalr	   r	   r
   r      s    zIncrementalEncoder.encodeN)F)r   r   r   r   r	   r	   r	   r
   r      s   r   c               @   s   e Zd ZdddZdS )IncrementalDecoderFc             C   s   | j dksttj|S )Nr   )r   r   r   r   )r   r   r   r	   r	   r
   r   !   s    zIncrementalDecoder.decodeN)F)r   r   r   r   r	   r	   r	   r
   r       s   r   c               @   s   e Zd ZeZdS )StreamWriterN)r   r   r   bytescharbuffertyper	   r	   r	   r
   r   %   s   r   c               @   s   e Zd ZeZdS )StreamReaderN)r   r   r   r   r   r	   r	   r	   r
   r   (   s   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    r%   )r   )r   )__doc__r#   r   r   r   r   r   r   r   r   r%   r	   r	   r	   r
   <module>   s   

