Skip to content

Conversation

@mzukowski-reef
Copy link

No description provided.

:vartype ~.content_sha1: str or None
"""
def __init__(self, content_sha1=None):
self.content_sha1 = content_sha1 # NOTE: b2sdk.transfer.upload_manager *writes* to this field
Copy link
Author

Choose a reason for hiding this comment

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

it is better to create a setter...

"""
Return a 40-character string containing the hex SHA1 checksum of the data in the file.
Return a 40-character string containing the hex sha1 checksum of the data in the file.
The implementation of this method may cache the checksum value to avoid recalculating it.
Copy link
Author

Choose a reason for hiding this comment

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

I don't like this design - get_content_sha1 may or may not set the content_sha1 field... :/

if size is None or len(data) < size:
self.hash = self.digest.hexdigest()
if self.upload_source is not None:
self.upload_source.content_sha1 = self.hash
Copy link
Author

Choose a reason for hiding this comment

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

bleeeh

file_id,
part_number,
part_upload_source.get_content_length(),
HEX_DIGITS_AT_END,
Copy link
Author

Choose a reason for hiding this comment

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

sha1_checksum?

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.

3 participants