Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/zmq/utils/__pycache__/z85.cpython-39.pyc
Ðазад
a a�h� � @ sl d Z ddlZddlZejd dkZdZedd� ee�D ��Zdd� e d�D �ddd � Z d d� Zdd � ZdS )z�Python implementation of Z85 85-bit encoding Z85 encoding is a plaintext encoding for a bytestring interpreted as 32bit integers. Since the chunks are 32bit, a bytestring must be a multiple of 4 bytes. See ZMQ RFC 32 for details. � N� sU 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-:+=^!/*?&<>()[]{}@%$#c C s g | ]\}}||f�qS � r )�.0�idx�cr r �}/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/zmq/utils/z85.py� <listcomp> � r c C s g | ]}d | �qS )�U r )r �ir r r r r � ���c C s� t | �d rtdt | � ��t | �d }t�d| | �}g }|D ]$}tD ]}|�t|| d � qHq@trrt|�S d� |�S dS )zencode raw bytes into Z85� z$length must be multiple of 4, not %i�>%dIr r N) �len� ValueError�struct�unpack�_85s�append�Z85CHARS�PY3�bytes�join)�rawbytes�nvalues�values�encoded�v�offsetr r r �encode s r c C s� t r8t| t�r8z| �d�} W n ty6 td��Y n0 t| �d rTtdt| � ��t| �d }g }tdt| �d�D ]<}d}tt �D ] \}}|t | || | 7 }q�|�|� qttj d| g|�R � S )z3decode Z85 bytes to raw bytes, accepts ASCII string�asciiz4string argument should contain only ASCII charactersr z(Z85 length must be multiple of 5, not %ir r )r � isinstance�strr �UnicodeEncodeErrorr r �range� enumerater �Z85MAPr r �pack)Zz85bytesr r r �value�jr r r r �decode, s r+ ) �__doc__�sysr �version_infor r �dictr&