File: //usr/lib/python3/dist-packages/twisted/conch/ssh/__pycache__/common.cpython-310.pyc
o
�b� � @ s� d Z ddlZddlmZ ddlmZ ddlmZ g d�Zdd� Z dd
d�Z
dd
� Zddd�Zdd� Z
eedddd��dd� �ZdS )z@
Common functions for the SSH classes.
Maintainer: Paul Swartz
� N)�int_to_bytes)�
deprecated)�Version)�NS�getNS�MP�getMP�ffsc C s( t | t�r
| �d�} t�dt| ��| S )z
net string
zutf-8�!L)�
isinstance�str�encode�struct�pack�len)�t� r �:/usr/lib/python3/dist-packages/twisted/conch/ssh/common.pyr s
r � c C sp g }d}t |�D ]$}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 r c C sP | dkrdS | dksJ �t | �}t|dd� �d@ rd| }t�dt|��| S )Nr s r � � �>L)r �ordr r r )�number�bnr r r r , s r c C sx g }d}t |�D ](}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"