-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
stdlib: base64 stream decoder #21348
base: master
Are you sure you want to change the base?
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.
My review doesn't mean much here but stylistic changes LGTM, thanks :)
Hello there, i just updated my branch. Is there anyone to review this? |
dcef5f0
to
f4fd478
Compare
var tempSource: [3]u8 = undefined; | ||
const bytesRead = try sourceReader.read(&tempSource); | ||
var temp_source: [3]u8 = undefined; | ||
const bytesRead = try source_reader.read(&temp_source); |
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.
Missed one: bytes_read
Decoding part related to #20961.
This proposes stream-friendly interface for base64 decoding (decoding to stream, decoding from read stream to write stream).
While writing this, i realized the original base64 decoder with ignored characters was doing some semi-complicated stuff to keep track of its decoding state. This rewrites the original decoder to rely on the decoder without ignores, moving the track keeping to simply chunking 4 valid characters using streams. This should be equivalent in performances and do not requires memory allocation either.