[Storage] [STG 104] Unique Put Block IDs#47821
Conversation
| # still returned so the block list can be committed in the correct order. | ||
| index = f"{chunk_offset:032d}" | ||
| block_id = encode_base64(url_quote(encode_base64(index))) | ||
| block_id = encode_base64(uuid4().bytes) |
There was a problem hiding this comment.
Double check if encode_base64 always produces same amount of bytes given the same length string.
There was a problem hiding this comment.
Ensure the length of the left and right matches.
There was a problem hiding this comment.
Look into how to pad this correctly
| def _upload_substream_block(self, index, block_stream): | ||
| try: | ||
| block_id = f"BlockId{(index//self.chunk_size):05}" | ||
| block_id = encode_base64(uuid4().bytes) |
There was a problem hiding this comment.
It would be breaking if we change to anything but 12 characters so make sure it's 12 characters.
There was a problem hiding this comment.
Lowest collision rate with 12 characters when truncatting
There was a problem hiding this comment.
random.randomint(12) characters...we need to have a seed (os.urandom cryptographically safe random)
There was a problem hiding this comment.
guids? (12 chars)
| ) | ||
| add_uri_regex_sanitizer( | ||
| regex=r"(?<=[?&]blockid=)[^&#]+", | ||
| value="00000000-0000-0000-0000-000000000000", |
There was a problem hiding this comment.
is this base 64 encoded? does it need to be?
maybe can put anything here...
can just put sanitized or japan or anything you want
No description provided.