
    hL
                     *    d dl Z  G d de          ZdS )    Nc                   <    e Zd ZdZdZddZd Zd Zd Zd Z	d	 Z
d
S )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                 N    d| _         |dk    r|                     |           d S d S )Nr   r   )_crcupdate)selfinitial_values     [/var/www/html/e360mart/e360mart_env/lib/python3.11/site-packages/google_crc32c/_checksum.py__init__zCommonChecksum.__init__   s4    	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                 6    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                 \    d                     | 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&     ty))00999r   c                 F    |                                  }| j        |_        |S )zvCreate another checksum with the same CRC32C value.

        Returns:
            Checksum: the new instance.
        )	__class__r   )r
   clones     r   copyzCommonChecksum.copy=   s!       Y
r   c              #   n   K   	 |                     |          }|sdS |                     |           |V  3)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.
        TN)readr	   )r
   stream	chunksizechunks       r   consumezCommonChecksum.consumeG   sI      	KK	**E KKKKK	r   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+      sN    E E E E EV E E E E Er   