o
    #j:
                     @  sJ   d dl mZ d dlmZ ddlmZ erd dlmZmZ G dd dZ	dS )	    )annotations)TYPE_CHECKING   )crc32c)BufferSelfc                   @  s|   e Zd ZdZed ddZed ddZed!d	d
Zed ddZd"d#ddZ	d$ddZ
d%ddZd!ddZd&ddZdS )'
CRC32CHashzQWrapper class for crc32c. Tries to conform to the interface of `hashlib` classes.returnintc                 C     dS )z:
        The size of the resulting hash in bytes.
            selfr   r   R/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/crc32c/_crc32hash.pydigest_size      zCRC32CHash.digest_sizec                 C  r   )zI
        The internal block size of the hash algorithm in bytes.
        r   r   r   r   r   r   
block_size   r   zCRC32CHash.block_sizestrc                 C  r   )z2
        The canonical name of this hash,
        r   r   r   r   r   r   name   r   zCRC32CHash.namec                 C  s   | j S )zT
        The checksum calculated so far. Not part of the hashlib interface.
        )	_checksumr   r   r   r   checksum#   s   zCRC32CHash.checksum    datar   gil_release_modeNonec                 C  s   t ||d| _|| _dS )z
        Initialise the hash object with an optional bytes-like object.
        Uses the given GIL release mode on each checksum calculation.
        r   Nr   r   _gil_release_mode)r   r   r   r   r   r   __init__*   s   
zCRC32CHash.__init__c                 C  s   t || j| jd| _dS )z
        Update the hash object with the bytes-like object.
        Repeated calls are equivalent to a single call with the concatenation of all the arguments:
        m.update(a); m.update(b) is equivalent to m.update(a+b).
        r   Nr   )r   r   r   r   r   update2   s   
zCRC32CHash.updatebytesc                 C  s   | j ddS )z
        Return the digest of the data passed to the update() method so far.
        This is a bytes object of size digest_size which may contain bytes in the whole range from 0 to 255.
        r   big)r   to_bytesr   r   r   r   digest<   s   zCRC32CHash.digestc                 C  s   |    S )z
        Like digest() except the digest is returned as a string object of double length,
        containing only hexadecimal digits.
        This may be used to exchange the value safely in email or other non-binary environments.
        )r%   hexr   r   r   r   	hexdigestC   s   zCRC32CHash.hexdigestr   c                 C  s   t |  }| j|_| j|_|S )u   
        Return a copy (“clone”) of the hash object. This can be used to efficiently compute
        the digests of data sharing a common initial substring.
        )typer   r   )r   resr   r   r   copyK   s   
zCRC32CHash.copyN)r	   r
   )r	   r   )r   r   )r   r   r   r
   r	   r   )r   r   r	   r   )r	   r"   )r	   r   )__name__
__module____qualname____doc__propertyr   r   r   r   r    r!   r%   r'   r*   r   r   r   r   r      s    



r   N)

__future__r   typingr   Z_crc32cr   Ztyping_extensionsr   r   r   r   r   r   r   <module>   s    