HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/twisted/conch/ssh/__pycache__/common.cpython-310.pyc
o

�b��@s�dZddlZddlmZddlmZddlmZgd�Zdd�Z	dd
d�Z
dd
�Zddd�Zdd�Z
eedddd��dd��ZdS)z@
Common functions for the SSH classes.

Maintainer: Paul Swartz
�N)�int_to_bytes)�
deprecated)�Version)�NS�getNS�MP�getMP�ffscCs(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.pyrs

r�cCspg}d}t|�D]$}t�d|||d��\}|�||dd||��|d|7}qt|�||d�fS)z
    get net string
    rr
�N)�ranger�unpack�append�tuple)�s�count�ns�c�i�lrrrrsrcCsP|dkrdS|dksJ�t|�}t|dd��d@rd|}t�dt|��|S)Nrsr���>L)r�ordrrr)�number�bnrrrr,src	Csxg}d}t|�D](}t�d|||d��\}|�t�||d|d|�d��|d|7}qt|�||d�fS)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.
    rr"r�bigN)rrrr�int�
from_bytesr)�datar�mprr�lengthrrrr6s&rcCs|D]
}||vr|SqdS)zs
    first from second
    goes through the first list, looking for items in the second, returns the first one
    Nr)rrrrrrr	Gs
��r	�Twisted��cCsdS)Nrrrrr�installQsr/)r)�__doc__r�cryptography.utilsr�twisted.python.deprecater�twisted.python.versionsr�__all__rrrrr	r/rrrr�<module>s