-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(storage/transfermanager): checksum full object downloads #10569
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general looks really good, a few minor questions/comments. Also, could you add a note to the docs to indicate under what circumstances checksumming will be performed?
@@ -31,6 +33,12 @@ import ( | |||
"google.golang.org/api/iterator" | |||
) | |||
|
|||
// maxChecksumZeroArraySize is the maximum amount of memory to allocate for | |||
// updating the checksum. A larger size will occupy more memory but will require | |||
// more updates when computing the crc32c of a full object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems wrong, I would imagine larger means fewer updates?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, I messed up that wording.
|
||
// joinCRC32C pieces together the initial checksum with the orderedChecksums | ||
// provided to calculate the checksum of the whole. | ||
func joinCRC32C(initialChecksum uint32, orderedChecksums []crc32cPiece) uint32 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems surprising that this isn't available in hash/crc32 or elsewhere in a standard library, but I assume you looked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, there was a feature request for it a while back but they considered it not common enough a use-case to include in the standard library: golang/go#12297
No description provided.