a
    Døg±  ã                   @   s$   d dl Z d dlmZ dZdd„ ZdS )é    N)ÚUnsupportedOperationi   c              	   C   s–   d}t | dƒr|  ¡ }z|  d¡ W n ttfy:   Y n0 t tdƒrVt | tj¡}n$t ¡ }|  t	¡}|snqz| 
|¡ q^t | dƒrŽ|  |¡ | ¡ S )zU
    Compute the hash of a file-like object, without loading it all into memory.
    r   ÚtellÚfile_digestÚseek)Úhasattrr   r   ÚAttributeErrorr   Úhashlibr   Úsha1ÚreadÚHASH_READ_SIZEÚupdateÚ	hexdigest)ZfilelikeZfile_posZhasherÚdata© r   úQ/var/www/lab.imftr.de/x/nb_venv/lib/python3.9/site-packages/wagtail/utils/file.pyÚhash_filelike   s"    




r   )r   Úior   r   r   r   r   r   r   Ú<module>   s   