
    ѮhL
                     "    d dl Z  G d de      Zy)    Nc                   :    e Zd ZdZdZd
dZd Zd Zd Zd Z	d Z
y	)CommonChecksuma  Hashlib-alike helper for CRC32C operations.

    This class should not be used directly and requires an update implementation.

    Args:
        initial_value (Optional[bytes]): the initial chunk of data from
            which the CRC32C checksum is computed.  Defaults to b''.
     c                 @    d| _         |dk7  r| j                  |       y y )Nr       )_crcupdate)selfinitial_values     i/home/www/academy-backend.kofcorporation.com/venv/lib/python3.12/site-packages/google_crc32c/_checksum.py__init__zCommonChecksum.__init__   s"    	CKK&  r   c                     t               )zUpdate the checksum with a new chunk of data.

        Args:
            chunk (Optional[bytes]): a chunk of data used to extend
                the CRC32C checksum.
        )NotImplemented)r
   datas     r   r	   zCommonChecksum.update"   s     r   c                 B    t        j                  d| j                        S )zBig-endian order, per RFC 4960.

        See: https://cloud.google.com/storage/docs/json_api/v1/objects#crc32c

        Returns:
            bytes: An eight-byte digest string.
        z>L)structpackr   r
   s    r   digestzCommonChecksum.digest+   s     {{4++r   c                 V    dj                  | j                        j                  d      S )zLike :meth:`digest` except returns as a bytestring of double length.

        Returns
            bytes: A sixteen byte digest string, contaiing only hex digits.
        z{:08x}ascii)formatr   encoder   s    r   	hexdigestzCommonChecksum.hexdigest5   s"     tyy)0099r   c                 H    | j                         }| j                  |_        |S )zvCreate another checksum with the same CRC32C value.

        Returns:
            Checksum: the new instance.
        )	__class__r   )r
   clones     r   copyzCommonChecksum.copy=   s       YY
r   c              #   `   K   	 |j                  |      }|sy| j                  |       | *w)a;  Consume chunks from a stream, extending our CRC32 checksum.

        Args:
            stream (BinaryIO): the stream to consume.
            chunksize (int): the size of the read to perform

        Returns:
            Generator[bytes, None, None]: Iterable of the chunks read from the
            stream.
        N)readr	   )r
   stream	chunksizechunks       r   consumezCommonChecksum.consumeG   s5      KK	*EKKK s   ,.N)r   )__name__
__module____qualname____doc__	__slots__r   r	   r   r   r   r$   r   r   r   r   r      s,     I'
,:r   r   )r   objectr   r   r   r   <module>r+      s    EV Er   