To validate data integrity and detect changes, Cloud Storage encourages you to use checksums when transferring data to and from your buckets. This page provides information about how checksums are used within Cloud Storage and how to specify checksums when sending requests.
Prevent data corruption by using checksums
Data can sometimes get corrupted while being transferred to or from the cloud because of software or hardware bugs, memory or router errors, electrical disturbances, or changes to the source data during extended period file uploads.
To help protect you against data corruption, Cloud Storage supports the use of CRC32C and MD5 checksums for verifying the integrity of your data and detecting changes in your data.
CRC32C is the recommended validation method for performing integrity checks. Validation using MD5 hashes is supported for single-file uploads but isn't supported for objects that are uploaded in chunks, such as composite objects and objects uploaded using an XML API multipart upload.
Checksums for data writes
For object writes, the client calculates the checksum of the local file and
attaches it to the HTTP headers of the object upload request. The server
receives the data payload, calculates its own checksum, and
validates the data by comparing both checksums after the upload completes.
If the checksums match, the object is stored in Cloud Storage along
with its checksums. If the checksums don't match, the write request is rejected
with a BadRequestException: 400 error.
Server-side validation for data writes
Cloud Storage performs server-side validation in the following cases:
When you supply an object's MD5 or CRC32C hash in an object upload request. To learn about types of object uploads, see Object uploads.
When you perform a copy or rewrite request within Cloud Storage. For object copy and rewrite requests, Cloud Storage automatically performs server-side validation based on a