a
    tDf	                     @  s   d dl mZ d dlZd dlZg Zzd dlZW n ey>   Y n0 ejdkr\dd Ze	e zd dl
Z
W n eyz   Y n0 dd Ze	e zd dlZW n ey   Y n0 dd	 Ze	e d
d Ze	e dddZdddZdS )    )annotationsNz0.2.2c                 C  s   t | }|ddS )zJ
            Produce a 16-bytes hash of *buf* using CityHash.
               little)cityhashZCityHash128to_bytes)bufh r	   Y/nfs/NAS7/SABIOD/METHODE/ermites/ermites_venv/lib/python3.9/site-packages/dask/hashing.py_hash_cityhash   s    
r   c                 C  s   t |  S )z?
        Produce a 8-bytes hash of *buf* using xxHash.
        )xxhashZxxh64digestr   r	   r	   r
   _hash_xxhash(   s    r   c                 C  s
   t | S )zD
        Produce a 16-bytes hash of *buf* using MurmurHash.
        )mmh3Z
hash_bytesr   r	   r	   r
   _hash_murmurhash6   s    r   c                 C  s   t |  S )z6
    Produce a 20-bytes hash of *buf* using SHA1.
    )hashlibsha1r   r   r	   r	   r
   
_hash_sha1?   s    r   c              
   C  sp   |dur*z
|| W S  t tfy(   Y n0 tD ]*}z|| W   S  t tfyV   Y q.0 q.t dt|  dS )z
    Hash a bytes-like (buffer-compatible) object.  This function returns
    a good quality hash but is not cryptographically secure.  The fastest
    available algorithm is selected.  A fixed-length bytes object is returned.
    Nzunsupported type for hashing: )	TypeErrorOverflowErrorhasherstype)r   hasherr	   r	   r
   hash_bufferI   s    
r   c                 C  s   t | |}t|}| S )zJ
    Same as hash_buffer, but returns its result in hex-encoded form.
    )r   binasciib2a_hexdecode)r   r   r   sr	   r	   r
   hash_buffer_hex^   s    

r   )N)N)
__future__r   r   r   r   r   ImportError__version__r   appendr   r   r   r   r   r   r   r	   r	   r	   r
   <module>   s4   	





