ϪfdZddlZddlmZddlmZddlmZgdZdZ ddZ d Z dd Z d Z eed d dddZy)z@ Common functions for the SSH classes. Maintainer: Paul Swartz N) int_to_bytes) deprecated)Version)NSgetNSMPgetMPffsct|tr|jd}tjdt ||zS)z net string zutf-8!L) isinstancestrencodestructpacklen)ts :/usr/lib/python3/dist-packages/twisted/conch/ssh/common.pyrrs6!S HHW  ;;tSV $q ((cg}d}t|D]E}tjd|||dz\}|j||dzd|z|z|d|zz }Gt |||dfzS)z get net string rr N)rangerunpackappendtuple)scountnscils rrrs B A 5\}}T1QQ<0 !AEAEAI&' QU  9!"x rc|dk(ry|dkDsJt|}t|dddzrd|z}tjdt ||zS)Nrs>L)rordrrr)numberbns rrr,sW { A:: f B 2a7|c r\ ;;tSW % **rc g}d}t|D]Y}tjd|||dz\}|jtj ||dz|dz|zd|d|zz }[t |||dfzS)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&rbigN)rrrrint from_bytesr)datarmprr lengths rr r 6s B A 5\MM$QQ8  #..a!ea!efn!=uEF QZ 9QR{ ""rc"|D] }||vs|cSy)zs first from second goes through the first list, looking for items in the second, returns the first one N)rrr s rr r Gs  6HrTwistedcy)Nr2r2rrinstallr7Qs r)r#)__doc__rcryptography.utilsrtwisted.python.deprecatertwisted.python.versionsr__all__rrrr r r7r2rrr=sZ +/+ /)  +#" GIr1a () * r