Skip to content

feat(storage): setting default checksum#32411

Open
shubhangi-google wants to merge 2 commits intogoogleapis:mainfrom
shubhangi-google:setting_default_checksum_updated
Open

feat(storage): setting default checksum#32411
shubhangi-google wants to merge 2 commits intogoogleapis:mainfrom
shubhangi-google:setting_default_checksum_updated

Conversation

@shubhangi-google
Copy link
Contributor

@shubhangi-google shubhangi-google commented Feb 2, 2026

This pull request introduces a significant enhancement to the Google Cloud Storage Ruby client by establishing CRC32c as the default checksum for file uploads. This change ensures that data integrity is automatically verified for uploads where a checksum isn't explicitly specified, thereby improving the reliability of data handling.

Highlights

  • Default Checksum: The default checksum algorithm for file uploads in the Google Cloud Storage Ruby client has been changed to CRC32c, enhancing data integrity by default when no specific checksum is provided.
  • Documentation Update: The documentation for the checksum parameter in bucket.rb has been updated to clearly state that crc32c is now the default.

Note: Opening this PR as older PR was getting corrupted

@shubhangi-google shubhangi-google changed the title merging commits and main branch Setting default checksum Feb 2, 2026
@shubhangi-google shubhangi-google changed the title Setting default checksum feat(storage): setting default checksum Feb 2, 2026
@shubhangi-google shubhangi-google marked this pull request as ready for review February 2, 2026 18:21
@shubhangi-google shubhangi-google force-pushed the setting_default_checksum_updated branch 2 times, most recently from 894976e to 8a69368 Compare February 5, 2026 08:35
#
# Acceptable values are:
#
# * `true` [Boolean] - Calculate and provide a checksum using the CRC32c hash.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So true and crc32c will do the same thing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

# If no checksum type or specific value is provided, the default will be set to crc32c.
# If the checksum is set to false, it will be disabled.
if [checksum, crc32c, md5].all?(&:nil?) || checksum == true
crc32c = Google::Cloud::Storage::File::Verifier.crc32c_for(StringIO.new("Hello world"))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the string "Hello world" also be passed as a parameter for robustness?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants