-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
src: simplify base64 decoding in the lenient case #56905
Conversation
@lemire it seems the tests are failing |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #56905 +/- ##
==========================================
+ Coverage 88.70% 89.07% +0.37%
==========================================
Files 663 665 +2
Lines 192012 192586 +574
Branches 36613 37014 +401
==========================================
+ Hits 170317 171543 +1226
+ Misses 14520 13838 -682
- Partials 7175 7205 +30
|
I am going to drop this PR because, as I feared, the expectation is that So it is not simply that Node.js does not validate, but it is also that it does not distinguish (at all) between
Somewhat ironically, here is what RFC 4648 section 5 says...
What Node.js does is to confuse the two encodings. Currently, the simdutf does not do that: it treats base64url and base64 as two different encodings (as per RFC 4648). So we need the current fallback code and my PR is not going to work. Note that Node.js can decode invalid sequences in interesting ways...
That's definitively not in RFC 4648. |
The simdutf library can be instructed to ignore invalid characters, which suggests that we may be able to simplify some of our C++ code.