o
    Žõ±j#  ã                   @   s   d d„ Z dS )c                 C   sH   | d dkr| d d S | d d }t j| dd| … ddd�| d S )zí
	LDAP protocol doesnt send the total length of the message in the header,
	it only sends raw ASN1 encoded data structures, which has the length encoded.
	This function "decodes" the length os the asn1 structure, and returns it as int.
	é   é   é   é€   ÚbigF)Ú	byteorderÚsigned)ÚintÚ
from_bytes)ÚdataÚbcount© r   úˆ/root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/msldap/protocol/utils.pyÚcalcualte_length   s   $r   N)r   r   r   r   r   Ú<module>   s   