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
Add variants without padding #14
Conversation
Section 3.2 of RFC 4648 notes that the padding of base64 encoded data may be omitted when the length of the encoded data is known implicitly.
I might not be opposed to this addition in principle, but on first glance this patch is mostly a vast amount of copypasta, and I will not accept a massive amount of purposeless code duplication. The patch is also far too big to review, and offers no explanation for why there is so much code to achieve so little. I would much rather see a series of small, understandable patches that make only the minimal changes necessary. I also don't see the point of adding more modules, so if you really need to do that, you'll want to explain your reasoning here. Thanks. |
I agree that the code duplication is not nice. The reason why I added new modules is to follow the existing pattern of exposing different variants (lazy, URL) as separate module with a unified API ( I see three options:
Let me know which one you prefer or if there is another option that I missed. |
Any preference? #2 doesn't seem viable. |
Maintainers, any decision on how to proceed with this? This is a standard feature in Base64 libraries and I personally need it in my code. What is the way forward please?
|
The diff doesn't look that massive to me, though I'm all for moving more stuff to an |
Re: 3, instead of
as the first parameter to make the code more future proof. |
@bos's original objection was that the patch introduced excess copypasta. If the patch was reworked to remedy this (see above comments for suggestions), I think that the fixed version would be gladly accepted. |
Though if @hvr agrees, we may just merge it as is. |
Closing in favour of #26. |
Section 3.2 of RFC 4648 notes that the padding of base64 encoded data may be omitted when the length of the encoded data is known implicitly. This is the case for many applications that require a textual encoding of binary data. Examples include JSON and URLs.