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 proposal #372

Merged
merged 5 commits into from
Oct 23, 2024
Merged

Base64 proposal #372

merged 5 commits into from
Oct 23, 2024

Conversation

qurbonzoda
Copy link
Contributor

@qurbonzoda qurbonzoda commented Feb 20, 2024

Only comment here about the text itself. The discussion about the feature is done in #373.

This KEEP proposes to introduce a multiplatform API for Base64 encoding and decoding.

@qurbonzoda qurbonzoda requested a review from ilya-g February 20, 2024 15:05
proposals/stdlib/base64.md Show resolved Hide resolved
proposals/stdlib/base64.md Outdated Show resolved Hide resolved
e.g., `Base64.getDecoder().decode(...)`. This led us to avoid separating the encoder and decoder into different entities.
We also didn't find evidence that the benefits of such a separation outweigh the usage inconvenience.
Second, encoding to `String` and decoding from `String` are considerably more popular than encoding to `ByteArray` and
decoding from `ByteArray`. Thus, we decided to make the more frequently used functions shorter.
Copy link
Member

Choose a reason for hiding this comment

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

Another reason was that a compound operation like "encode bytearray to base64 string + encode string to utf8 byte array" should have a compound name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reverse operation (utf8 byte array -> string -> byte array) doesn't have a compound name.

Copy link
Member

@ilya-g ilya-g Oct 21, 2024

Choose a reason for hiding this comment

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

Yes, in that case we didn't complicate the name thanks to overloading on parameter types, but the main principle in naming holds, so it's worth to mention it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@qurbonzoda qurbonzoda requested a review from ilya-g October 18, 2024 10:10
@qurbonzoda qurbonzoda merged commit e3ce903 into master Oct 23, 2024
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.

2 participants