Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions google/cloud/storage/blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -1874,13 +1874,32 @@ def update_storage_class(self, new_class, client=None):
crc32c = _scalar_property("crc32c")
"""CRC32C checksum for this object.

This returns the blob's CRC32C checksum. To retrieve the value, first use a
reload method of the Blob class which loads the blob's properties from the server.

See `RFC 4960`_ and `API reference docs`_.

If not set before upload, the server will compute the hash.

:rtype: str or ``NoneType``

.. _RFC 4960: https://tools.ietf.org/html/rfc4960#appendix-B

Example:
Retrieve the crc32c hash of blob.

>>> from google.cloud import storage
>>> client = storage.Client()
>>> bucket = client.get_bucket("my-bucket-name")
>>> blob = bucket.blob('my-blob')

>>> blob.crc32c # return None
>>> blob.reload()
>>> blob.crc32c # return crc32c hash

>>> # Another approach
>>> blob = bucket.get_blob('my-blob')
>>> blob.crc32c # return crc32c hash
"""

@property
Expand Down Expand Up @@ -1954,13 +1973,32 @@ def id(self):
md5_hash = _scalar_property("md5Hash")
"""MD5 hash for this object.

This returns the blob's MD5 hash. To retrieve the value, first use a
reload method of the Blob class which loads the blob's properties from the server.

See `RFC 1321`_ and `API reference docs`_.

If not set before upload, the server will compute the hash.

:rtype: str or ``NoneType``

.. _RFC 1321: https://tools.ietf.org/html/rfc1321

Example:
Retrieve the md5 hash of blob.

>>> from google.cloud import storage
>>> client = storage.Client()
>>> bucket = client.get_bucket("my-bucket-name")
>>> blob = bucket.blob('my-blob')

>>> blob.md5_hash # return None
>>> blob.reload()
>>> blob.md5_hash # return md5 hash

>>> # Another approach
>>> blob = bucket.get_blob('my-blob')
>>> blob.md5_hash # return md5 hash
"""

@property
Expand Down