
    5i:
                    P    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      Z	y)	    )annotations)TYPE_CHECKING   )crc32c)BufferSelfc                      e Zd ZdZedd       Zedd       Zedd       Zedd       ZdddZ	ddZ
ddZdd	Zdd
Zy)
CRC32CHashzQWrapper class for crc32c. Tries to conform to the interface of `hashlib` classes.c                     y)z:
        The size of the resulting hash in bytes.
            selfs    s/home/marpiech/ifpan-abm-pgxpred/analysis/marpiech-gwas-test/venv/lib/python3.12/site-packages/crc32c/_crc32hash.pydigest_sizezCRC32CHash.digest_size       
     c                     y)zI
        The internal block size of the hash algorithm in bytes.
        r   r   r   s    r   
block_sizezCRC32CHash.block_size   r   r   c                     y)z2
        The canonical name of this hash,
        r   r   r   s    r   namezCRC32CHash.name   s    
 r   c                    | j                   S )zT
        The checksum calculated so far. Not part of the hashlib interface.
        )	_checksumr   s    r   checksumzCRC32CHash.checksum#   s    
 ~~r   c                6    t        ||      | _        || _        y)z
        Initialise the hash object with an optional bytes-like object.
        Uses the given GIL release mode on each checksum calculation.
        gil_release_modeNr   r   _gil_release_mode)r   datar   s      r   __init__zCRC32CHash.__init__*   s    
  7GH!1r   c                R    t        || j                  | j                        | _        y)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    s     r   updatezCRC32CHash.update2   s!      $..43I3I
r   c                :    | j                   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   s    r   digestzCRC32CHash.digest<   s    
 ~~&&q%00r   c                >    | j                         j                         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   s    r   	hexdigestzCRC32CHash.hexdigestC   s     {{}  ""r   c                j     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   ress     r   copyzCRC32CHash.copyK   s/    
 d4jl $ 6 6
r   N)returnint)r/   str)r   )r    r   r   r0   r/   None)r    r   r/   r3   )r/   bytes)r/   r   )__name__
__module____qualname____doc__propertyr   r   r   r   r!   r#   r'   r*   r.   r   r   r   r
   r
      sl    [       2
1#r   r
   N)

__future__r   typingr   _crc32cr   typing_extensionsr   r   r
   r   r   r   <module>r>      s     "   .H Hr   