← Back
Editing: common.cpython-38.pyc
U W[} � @ s� d Z ddlmZmZ ddlZddlmZmZ ddlm Z ddl mZ ddlm Z dd d ddgZd d� Zddd �Zdd � Zddd�Zdd� Zdd� Zee dddd��dd� �ZdS )z@ Common functions for the SSH classes. Maintainer: Paul Swartz � )�absolute_import�divisionN)�int_from_bytes�int_to_bytes)�unicode)� deprecated)�Version�NS�getNS�MP�getMP�ffsc C s( t | t�r| �d�} t�dt| ��| S )z net string zutf-8�!L)� isinstancer �encode�struct�pack�len)�t� r �:/usr/lib/python3/dist-packages/twisted/conch/ssh/common.pyr s � c C sp g }d}t |�D ]H}t�d| ||d � �\}|�| |d d| | � � |d| 7 }qt|�| |d� f S )z get net string r r � N)�ranger �unpack�append�tuple)�s�count�ns�c�i�lr r r r # s c C sP | dkrdS | dkst �t| �}t|dd� �d@ r<d| }t�dt|��| S )Nr s r � � �>L)�AssertionErrorr �ordr r r )ZnumberZbnr r r r 1 s c C sv g }d}t |�D ]N}t�d| ||d � �\}|�t| |d |d | � d�� |d| 7 }qt|�| |d� f S )a= Get multiple precision integer out of the string. A multiple precision integer is stored as a 4-byte length followed by length bytes of the integer. If count is specified, get count integers out of the string. The return value is a tuple of count integers followed by the rest of the data. r r% r ZbigN)r r r r r r )�datar Zmpr r! Zlengthr r r r <