Skip to content
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

base64: add encode and decode to io, fixed #2964 #2965

Merged
merged 2 commits into from
Jul 7, 2016

Conversation

kostya
Copy link
Contributor

@kostya kostya commented Jul 7, 2016

No description provided.

@asterite
Copy link
Member

asterite commented Jul 7, 2016

@kostya So fast!! 😍

@@ -67,6 +67,28 @@ module Base64
end
end

# :nodoc:
def encode(data, io : IO)
inc = 0
Copy link
Member

Choose a reason for hiding this comment

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

@kostya This inc, LINE_SIZE and NL logic is duplicated, it also appears below. Could we extract it to a new method that tracks inc and yields the appropriate bytes? I don't know the name, probably the current to_base64 should be to_strict_base64 and this new one should be to_base64, but the names aren't very important. What do you think?

@asterite
Copy link
Member

asterite commented Jul 7, 2016

@kostya Thank you!!

@asterite asterite merged commit 405528c into crystal-lang:master Jul 7, 2016
@asterite asterite added this to the 0.19.0 milestone Jul 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants