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

Revert the revert of fastEncodeBase64Url method #2782

Merged
merged 2 commits into from
Sep 24, 2024

Conversation

anonrig
Copy link
Member

@anonrig anonrig commented Sep 24, 2024

Applying the suggestion of adding a null terminator before passing the input to kj::String

Reverts #2776

@anonrig
Copy link
Member Author

anonrig commented Sep 24, 2024

Internal PR passes

@anonrig anonrig merged commit feb1cc7 into main Sep 24, 2024
14 of 15 checks passed
@anonrig anonrig deleted the yagiz/revert-revert-encode-base64 branch September 24, 2024 14:15
auto output = kj::heapArray<char>(expected_length + 1);
auto actual_length = simdutf::binary_to_base64(
bytes.asChars().begin(), bytes.size(), output.asChars().begin(), simdutf::base64_url);
output[actual_length] = '\0';
Copy link
Contributor

Choose a reason for hiding this comment

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

FWIW, I noticed the old code had an assert that expected was close to actual. But maybe this isn't crucial to recheck, if we trust simdutf to make the same guarantee with regard to base64_length_from_binary() and binary_to_base64().

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.

3 participants