
    (phL
                     "    S SK r  " S S\5      rg)    Nc                   D    \ rS rSrSrSrSS jrS rS rS r	S r
S	 rS
rg)CommonChecksum   a  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                 B    SU l         US:w  a  U R                  U5        g g )Nr       )_crcupdate)selfinitial_values     J/var/www/html/venv/lib/python3.13/site-packages/google_crc32c/_checksum.py__init__CommonChecksum.__init__   s"    	CKK&  r   c                     [        5       e)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
   CommonChecksum.update"   s     r   c                 D    [         R                  " SU R                  5      $ )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   digestCommonChecksum.digest+   s     {{4++r   c                 V    SR                  U R                  5      R                  S5      $ )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   	hexdigestCommonChecksum.hexdigest5   s"     tyy)0099r   c                 H    U R                  5       nU R                  Ul        U$ )z^Create another checksum with the same CRC32C value.

Returns:
    Checksum: the new instance.
)	__class__r	   )r   clones     r   copyCommonChecksum.copy=   s       YY
r   c              #   l   #     UR                  U5      nU(       d  gU R                  U5        Uv   M0  7f)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   consumeCommonChecksum.consumeG   s4      KK	*EKKK s   24)r	   N)r   )__name__
__module____qualname____firstlineno____doc__	__slots__r   r
   r   r   r#   r*   __static_attributes__r   r   r   r   r      s,     I'
,:r   r   )r   objectr   r   r   r   <module>r4      s    EV Er   