o
    j                     @   s   dddZ dS )   .c                 C   s.  g }t dt| |D ]}| |||  }d}d}t dt|D ]1}||d kr+|d7 }|| }t|ts8t|}t|dd}t|dkrJd| }||d 7 }q|d}d}	|D ]"}
t|
tset|
}
d	|
  krod
k rxn n|	t|
7 }	qZ|	|7 }	qZ|	dt
|d d  d |||	f  q
d|S )z
	Pretty printing binary data blobs
	:param src: Binary blob
	:type src: bytearray
	:param length: Size of data in each row
	:type length: int
	:param sep: Character to print when data byte is non-printable ASCII
	:type sep: str(char)
	:return: str
	     F    0x   0       z	%08X:  %-   zs  |%s|
)rangelen
isinstanceintordhexreplacestripchrappendstrjoin)srclengthsepresultisubSrchexaisMiddlehtextc r%   /root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/aiosmb/commons/utils/hexdump.pyhexdump   s2   



*
r'   N)r   r   )r'   r%   r%   r%   r&   <module>   s   