Repository navigation
Base64 part2 : base64url, UTF-8 inputs and base64_to_binary_safe #382
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
3a64443
trimming some unnecessary code
lemire 3f9cb0f
fixing missing rvv implementation
lemire a9ea1c6
completing the base64 implementation.
lemire 0f49240
adding ppc64
lemire 5daa520
saving
151aa09
saturated.
lemire b917aa8
finishing...
ca17560
various fixes
94b7dac
Implemented bun benchmark
lemire c35d8df
Obvious fix.
lemire 1a90f2a
documentation
lemire bd454ea
adding libbase64 competitor
lemire bdab72f
more documentation.
lemire 65f933b
base64url (first steps)
lemire 4aa837d
working through
lemire 8dc79aa
implemented base64url for ARM.
lemire fe1138f
documentation.
lemire 5d1d0d5
prototype base64url
21717c4
solved based64url
c96ac90
completing the base64 implementation.
lemire 106e18c
adding ppc64
lemire d1c9cbc
saving
8606798
saturated.
lemire e7eae70
finishing...
9262b4b
various fixes
3444f4e
Implemented bun benchmark
lemire 6949b2c
Obvious fix.
lemire 381945b
documentation
lemire 7b304d3
adding libbase64 competitor
lemire f51ffdf
more documentation.
lemire 3d87826
base64url (first steps)
lemire c72079c
working through
lemire 200b6bc
implemented base64url for ARM.
lemire 4971bc2
documentation.
lemire c729247
prototype base64url
e32acc9
solved based64url
038ce51
Merge branch 'base64_part2' of github.com:simdutf/simdutf into base64…
9154818
fixing a missing func definition (bad signature)
lemire fd037f5
no such thing as version 4 of uraimo/run-on-arch-action
lemire 0de753a
fixes
lemire ccdf51d
Update benchmarks/base64/benchmark_base64.cpp
lemire 7ec70f2
Update benchmarks/base64/benchmark_base64.cpp
lemire 18dc616
Update benchmarks/base64/libbase64_spaces.h
lemire aeb2f5f
Update include/simdutf/implementation.h
lemire e0ce663
Update src/haswell/avx2_base64.cpp
lemire bb9d1fc
various minor fixes (linting + comments)
f511d9a
adding another comment.
e2a224f
cleaning up the base64 benchmark flags
5e6a366
disabling Ubuntu rvv VLEN=1024 (clang 17) CI due to system failures
9a92c54
adding the option
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
adding libbase64 competitor
- Loading branch information
commit 7b304d3cd21efb484a814ba9dcf42ff6808f6e73
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
|
|
||
| // https://github.com/aklomp/base64/blob/b20a31a997e0b48274fa09e58b65ee9202531e4f/bin/base64.c#L392 | ||
| static inline size_t libbase64_find_space(const char *p, const size_t avail) { | ||
| for (size_t len = 0; len < avail; len++) { | ||
| if (p[len] == '\n' || p[len] == '\r' || p[len] == ' ' || p[len] == '\t') { | ||
| return len; | ||
| } | ||
| } | ||
|
|
||
| return avail; | ||
| } | ||
|
|
||
| // Inspired by | ||
| // https://github.com/aklomp/base64/blob/b20a31a997e0b48274fa09e58b65ee9202531e4f/bin/base64.c#L405 | ||
|
|
||
| static bool libbase64_space_decode(const char *start, size_t avail, char *outbuf, | ||
| size_t *outlen) { | ||
| struct base64_state state; | ||
| *outlen = 0; | ||
|
|
||
| // Initialize the decoder's state structure. | ||
| base64_stream_decode_init(&state, 0); | ||
|
|
||
| while (avail > 0) { | ||
| size_t len = libbase64_find_space(start, avail); | ||
| if (len == 0) { | ||
| start++; | ||
| avail--; | ||
| continue; | ||
| } | ||
|
|
||
| // Decode the chunk into the raw buffer. | ||
| size_t outlen = 0; | ||
| if (base64_stream_decode(&state, start, len, outbuf, &outlen) == 0) { | ||
| // decoding error | ||
| return false; | ||
| } | ||
|
|
||
| // Update the output buffer pointer and total size. | ||
| outbuf += outlen; | ||
| outlen += outlen; | ||
| if(avail == len) { | ||
| break; | ||
| } | ||
|
|
||
| start += len + 1; | ||
| avail -= len + 1; | ||
| } | ||
| return true; | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.