
    Yf                         d Z ddlZddlmZ ddlmZ ddlmZ g dZd Z	dd	Z
d
 ZddZd Z e edddd                    d             ZdS )z@
Common functions for the SSH classes.

Maintainer: Paul Swartz
    N)int_to_bytes)
deprecated)Version)NSgetNSMPgetMPffsc                     t          | t                    r|                     d          } t          j        dt          |                     | z   S )z
    net string
    zutf-8!L)
isinstancestrencodestructpacklen)ts    J/var/www/html/env/lib/python3.11/site-packages/twisted/conch/ssh/common.pyr   r      sD     !S HHW;tSVV$$q((       c                    g }d}t          |          D ]R}t          j        d| ||dz                      \  }|                    | |dz   d|z   |z                       |d|z   z  }St	          |          | |d         fz   S )z
    get net string
    r   r      N)ranger   unpackappendtuple)scountnscils         r   r   r      s     
B	A5\\  }T1QQY<00
		!AEAEAI%&'''	QU
99!""xr   c                     | dk    rdS | dk    sJ t          |           }t          |dd                   dz  rd|z   }t          j        dt	          |                    |z   S )Nr   s       r          >L)r   ordr   r   r   )numberbns     r   r   r   ,   sk    {{{A::::	f		B
2ac7||c r\;tSWW%%**r   c           	      6   g }d}t          |          D ]k}t          j        d| ||dz                      \  }|                    t                              | |dz   |dz   |z            d                     |d|z   z  }lt          |          | |d         fz   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   bigN)r   r   r   r   int
from_bytesr   )datar   mpr    r!   lengths         r   r	   r	   6   s     
B	A5\\  M$QQY88	
		#..a!ea!efn&<!=uEEFFF	QZ99QRR{""r   c                      | D ]
}||v r|c S dS )zs
    first from second
    goes through the first list, looking for items in the second, returns the first one
    N )r    r   r!   s      r   r
   r
   G   s4    
   66HHH  r   Twisted      c                      d S )Nr2   r2   r   r   installr7   Q   s	     	Dr   )r   )__doc__r   cryptography.utilsr   twisted.python.deprecater   twisted.python.versionsr   __all__r   r   r   r	   r
   r7   r2   r   r   <module>r=      s   
   + + + + + + / / / / / / + + + + + +
/
/
/) ) )
  
  
  
 + + +# # # #"   GGIr1a(())	 	 *)	 	 	r   