o
    Nrf	                     @  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w ejdkr.dd Ze	e zd dl
Z
W n	 ey=   Y n
w dd Ze	e zd dlZW n	 eyV   Y n
w 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	   U/var/www/html/software/conda/envs/catlas/lib/python3.10/site-packages/dask/hashing.py_hash_cityhash   s   
r   c                 C     t |  S )z?
        Produce a 8-bytes hash of *buf* using xxHash.
        )xxhashZxxh64digestr   r	   r	   r
   _hash_xxhash(      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  r   )z6
    Produce a 20-bytes hash of *buf* using SHA1.
    )hashlibsha1r   r   r	   r	   r
   
_hash_sha1?   r   r   c              
   C  sj   |durz|| W S  t tfy   Y nw tD ]}z|| W   S  t tfy+   Y qw t dt|  )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)
__future__r   r   r   r   r   ImportError__version__r   appendr   r   r   r   r   r   r!   r	   r	   r	   r
   <module>   s<    	





