| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - /* auto-generated on 2024-05-07 22:33:11 -0400. Do not edit! */ | ||
| 1 | + /* auto-generated on 2024-07-11 00:01:58 -0400. Do not edit! */ | ||
| 2 | 2 | /* begin file src/simdutf.cpp */ | |
| 3 | 3 | #include "simdutf.h" | |
| 4 | 4 | // We include base64_tables once. | |
@@ -1522,10 +1522,10 @@ template<> | |||
| 1522 | 1522 | struct simd16<bool>: base16<bool> { | |
| 1523 | 1523 | static simdutf_really_inline simd16<bool> splat(bool _value) { return vmovq_n_u16(uint16_t(-(!!_value))); } | |
| 1524 | 1524 | ||
| 1525 | - simdutf_really_inline simd16<bool>() : base16() {} | ||
| 1526 | - simdutf_really_inline simd16<bool>(const uint16x8_t _value) : base16<bool>(_value) {} | ||
| 1525 | + simdutf_really_inline simd16() : base16() {} | ||
| 1526 | + simdutf_really_inline simd16(const uint16x8_t _value) : base16<bool>(_value) {} | ||
| 1527 | 1527 | // Splat constructor | |
| 1528 | - simdutf_really_inline simd16<bool>(bool _value) : base16<bool>(splat(_value)) {} | ||
| 1528 | + simdutf_really_inline simd16(bool _value) : base16<bool>(splat(_value)) {} | ||
| 1529 | 1529 | ||
| 1530 | 1530 | }; | |
| 1531 | 1531 | ||
@@ -2832,10 +2832,10 @@ template<> | |||
| 2832 | 2832 | struct simd16<bool>: base16<bool> { | |
| 2833 | 2833 | static simdutf_really_inline simd16<bool> splat(bool _value) { return _mm256_set1_epi16(uint16_t(-(!!_value))); } | |
| 2834 | 2834 | ||
| 2835 | - simdutf_really_inline simd16<bool>() : base16() {} | ||
| 2836 | - simdutf_really_inline simd16<bool>(const __m256i _value) : base16<bool>(_value) {} | ||
| 2835 | + simdutf_really_inline simd16() : base16() {} | ||
| 2836 | + simdutf_really_inline simd16(const __m256i _value) : base16<bool>(_value) {} | ||
| 2837 | 2837 | // Splat constructor | |
| 2838 | - simdutf_really_inline simd16<bool>(bool _value) : base16<bool>(splat(_value)) {} | ||
| 2838 | + simdutf_really_inline simd16(bool _value) : base16<bool>(splat(_value)) {} | ||
| 2839 | 2839 | ||
| 2840 | 2840 | simdutf_really_inline bitmask_type to_bitmask() const { return _mm256_movemask_epi8(*this); } | |
| 2841 | 2841 | simdutf_really_inline bool any() const { return !_mm256_testz_si256(*this, *this); } | |
@@ -3803,10 +3803,10 @@ template<> | |||
| 3803 | 3803 | struct simd16<bool>: base16<bool> { | |
| 3804 | 3804 | static simdutf_really_inline simd16<bool> splat(bool _value) { return _mm_set1_epi16(uint16_t(-(!!_value))); } | |
| 3805 | 3805 | ||
| 3806 | - simdutf_really_inline simd16<bool>() : base16() {} | ||
| 3807 | - simdutf_really_inline simd16<bool>(const __m128i _value) : base16<bool>(_value) {} | ||
| 3806 | + simdutf_really_inline simd16() : base16() {} | ||
| 3807 | + simdutf_really_inline simd16(const __m128i _value) : base16<bool>(_value) {} | ||
| 3808 | 3808 | // Splat constructor | |
| 3809 | - simdutf_really_inline simd16<bool>(bool _value) : base16<bool>(splat(_value)) {} | ||
| 3809 | + simdutf_really_inline simd16(bool _value) : base16<bool>(splat(_value)) {} | ||
| 3810 | 3810 | ||
| 3811 | 3811 | simdutf_really_inline int to_bitmask() const { return _mm_movemask_epi8(*this); } | |
| 3812 | 3812 | simdutf_really_inline bool any() const { return !_mm_testz_si128(*this, *this); } | |
@@ -5807,6 +5807,13 @@ result base64_tail_decode_safe(char *dst, size_t& outlen, const char_type *src, | |||
| 5807 | 5807 | // Returns the number of bytes written. The destination buffer must be large | |
| 5808 | 5808 | // enough. It will add padding (=) if needed. | |
| 5809 | 5809 | size_t tail_encode_base64(char *dst, const char *src, size_t srclen, base64_options options) { | |
| 5810 | + // By default, we use padding if we are not using the URL variant. | ||
| 5811 | + // This is check with ((options & base64_url) == 0) which returns true if we are not using the URL variant. | ||
| 5812 | + // However, we also allow 'inversion' of the convention with the base64_reverse_padding option. | ||
| 5813 | + // If the base64_reverse_padding option is set, we use padding if we are using the URL variant, | ||
| 5814 | + // and we omit it if we are not using the URL variant. This is checked with | ||
| 5815 | + // ((options & base64_reverse_padding) == base64_reverse_padding). | ||
| 5816 | + bool use_padding = ((options & base64_url) == 0) ^ ((options & base64_reverse_padding) == base64_reverse_padding); | ||
| 5810 | 5817 | // This looks like 3 branches, but we expect the compiler to resolve this to a single branch: | |
| 5811 | 5818 | const char *e0 = (options & base64_url) ? tables::base64::base64_url::e0 : tables::base64::base64_default::e0; | |
| 5812 | 5819 | const char *e1 = (options & base64_url) ? tables::base64::base64_url::e1 : tables::base64::base64_default::e1; | |
@@ -5830,7 +5837,7 @@ size_t tail_encode_base64(char *dst, const char *src, size_t srclen, base64_opti | |||
| 5830 | 5837 | t1 = uint8_t(src[i]); | |
| 5831 | 5838 | *out++ = e0[t1]; | |
| 5832 | 5839 | *out++ = e1[(t1 & 0x03) << 4]; | |
| 5833 | - if((options & base64_url) == 0) { | ||
| 5840 | + if(use_padding) { | ||
| 5834 | 5841 | *out++ = '='; | |
| 5835 | 5842 | *out++ = '='; | |
| 5836 | 5843 | } | |
@@ -5841,7 +5848,7 @@ size_t tail_encode_base64(char *dst, const char *src, size_t srclen, base64_opti | |||
| 5841 | 5848 | *out++ = e0[t1]; | |
| 5842 | 5849 | *out++ = e1[((t1 & 0x03) << 4) | ((t2 >> 4) & 0x0F)]; | |
| 5843 | 5850 | *out++ = e2[(t2 & 0x0F) << 2]; | |
| 5844 | - if((options & base64_url) == 0) { | ||
| 5851 | + if(use_padding) { | ||
| 5845 | 5852 | *out++ = '='; | |
| 5846 | 5853 | } | |
| 5847 | 5854 | } | |
@@ -5869,7 +5876,14 @@ simdutf_warn_unused size_t maximal_binary_length_from_base64(const char_type * i | |||
| 5869 | 5876 | } | |
| 5870 | 5877 | ||
| 5871 | 5878 | simdutf_warn_unused size_t base64_length_from_binary(size_t length, base64_options options) noexcept { | |
| 5872 | - if(options & base64_url) { | ||
| 5879 | + // By default, we use padding if we are not using the URL variant. | ||
| 5880 | + // This is check with ((options & base64_url) == 0) which returns true if we are not using the URL variant. | ||
| 5881 | + // However, we also allow 'inversion' of the convention with the base64_reverse_padding option. | ||
| 5882 | + // If the base64_reverse_padding option is set, we use padding if we are using the URL variant, | ||
| 5883 | + // and we omit it if we are not using the URL variant. This is checked with | ||
| 5884 | + // ((options & base64_reverse_padding) == base64_reverse_padding). | ||
| 5885 | + bool use_padding = ((options & base64_url) == 0) ^ ((options & base64_reverse_padding) == base64_reverse_padding); | ||
| 5886 | + if(!use_padding) { | ||
| 5873 | 5887 | return length/3 * 4 + ((length % 3) ? (length % 3) + 1 : 0); | |
| 5874 | 5888 | } | |
| 5875 | 5889 | return (length + 2)/3 * 4; // We use padding to make the length a multiple of 4. | |
@@ -17055,8 +17069,6 @@ result compress_decode_base64(char *dst, const char_type *src, size_t srclen, | |||
| 17055 | 17069 | // can avoid the call to compress_block and decode directly. | |
| 17056 | 17070 | copy_block(&b, bufferptr); | |
| 17057 | 17071 | bufferptr += 64; | |
| 17058 | - // base64_decode_block(dst, &b); | ||
| 17059 | - // dst += 48; | ||
| 17060 | 17072 | } | |
| 17061 | 17073 | if (bufferptr >= (block_size - 1) * 64 + buffer) { | |
| 17062 | 17074 | for (size_t i = 0; i < (block_size - 1); i++) { | |
@@ -27138,8 +27150,8 @@ simdutf_really_inline __m256i lookup_pshufb_improved(const __m256i input) { | |||
| 27138 | 27150 | return _mm256_add_epi8(result, input); | |
| 27139 | 27151 | } | |
| 27140 | 27152 | ||
| 27141 | - template <base64_options options> | ||
| 27142 | - size_t encode_base64(char *dst, const char *src, size_t srclen) { | ||
| 27153 | + template <bool isbase64url> | ||
| 27154 | + size_t encode_base64(char *dst, const char *src, size_t srclen, base64_options options) { | ||
| 27143 | 27155 | // credit: Wojciech Muła | |
| 27144 | 27156 | const uint8_t *input = (const uint8_t *)src; | |
| 27145 | 27157 | ||
@@ -27206,18 +27218,18 @@ size_t encode_base64(char *dst, const char *src, size_t srclen) { | |||
| 27206 | 27218 | const __m256i input3 = _mm256_or_si256(t1_3, t3_3); | |
| 27207 | 27219 | ||
| 27208 | 27220 | _mm256_storeu_si256(reinterpret_cast<__m256i *>(out), | |
| 27209 | - lookup_pshufb_improved<options == base64_url>(input0)); | ||
| 27221 | + lookup_pshufb_improved<isbase64url>(input0)); | ||
| 27210 | 27222 | out += 32; | |
| 27211 | 27223 | ||
| 27212 | 27224 | _mm256_storeu_si256(reinterpret_cast<__m256i *>(out), | |
| 27213 | - lookup_pshufb_improved<options == base64_url>(input1)); | ||
| 27225 | + lookup_pshufb_improved<isbase64url>(input1)); | ||
| 27214 | 27226 | out += 32; | |
| 27215 | 27227 | ||
| 27216 | 27228 | _mm256_storeu_si256(reinterpret_cast<__m256i *>(out), | |
| 27217 | - lookup_pshufb_improved<options == base64_url>(input2)); | ||
| 27229 | + lookup_pshufb_improved<isbase64url>(input2)); | ||
| 27218 | 27230 | out += 32; | |
| 27219 | 27231 | _mm256_storeu_si256(reinterpret_cast<__m256i *>(out), | |
| 27220 | - lookup_pshufb_improved<options == base64_url>(input3)); | ||
| 27232 | + lookup_pshufb_improved<isbase64url>(input3)); | ||
| 27221 | 27233 | out += 32; | |
| 27222 | 27234 | } | |
| 27223 | 27235 | for (; i + 28 <= srclen; i += 24) { | |
@@ -27241,7 +27253,7 @@ size_t encode_base64(char *dst, const char *src, size_t srclen) { | |||
| 27241 | 27253 | const __m256i indices = _mm256_or_si256(t1, t3); | |
| 27242 | 27254 | ||
| 27243 | 27255 | _mm256_storeu_si256(reinterpret_cast<__m256i *>(out), | |
| 27244 | - lookup_pshufb_improved<options == base64_url>(indices)); | ||
| 27256 | + lookup_pshufb_improved<isbase64url>(indices)); | ||
| 27245 | 27257 | out += 32; | |
| 27246 | 27258 | } | |
| 27247 | 27259 | return i / 3 * 4 + scalar::base64::tail_encode_base64((char *)out, src + i, | |
@@ -30012,9 +30024,9 @@ simdutf_warn_unused size_t implementation::base64_length_from_binary(size_t leng | |||
| 30012 | 30024 | ||
| 30013 | 30025 | size_t implementation::binary_to_base64(const char * input, size_t length, char* output, base64_options options) const noexcept { | |
| 30014 | 30026 | if(options & base64_url) { | |
| 30015 | - return encode_base64<base64_url>(output, input, length); | ||
| 30027 | + return encode_base64<true>(output, input, length, options); | ||
| 30016 | 30028 | } else { | |
| 30017 | - return encode_base64<base64_default>(output, input, length); | ||
| 30029 | + return encode_base64<false>(output, input, length, options); | ||
| 30018 | 30030 | } | |
| 30019 | 30031 | } | |
| 30020 | 30032 | } // namespace haswell | |
@@ -35675,8 +35687,8 @@ template <bool base64_url> __m128i lookup_pshufb_improved(const __m128i input) { | |||
| 35675 | 35687 | return _mm_add_epi8(result, input); | |
| 35676 | 35688 | } | |
| 35677 | 35689 | ||
| 35678 | - template <base64_options options> | ||
| 35679 | - size_t encode_base64(char *dst, const char *src, size_t srclen) { | ||
| 35690 | + template <bool isbase64url> | ||
| 35691 | + size_t encode_base64(char *dst, const char *src, size_t srclen, base64_options options) { | ||
| 35680 | 35692 | // credit: Wojciech Muła | |
| 35681 | 35693 | // SSE (lookup: pshufb improved unrolled) | |
| 35682 | 35694 | const uint8_t *input = (const uint8_t *)src; | |
@@ -35727,19 +35739,19 @@ size_t encode_base64(char *dst, const char *src, size_t srclen) { | |||
| 35727 | 35739 | const __m128i input3 = _mm_or_si128(t1_3, t3_3); | |
| 35728 | 35740 | ||
| 35729 | 35741 | _mm_storeu_si128(reinterpret_cast<__m128i *>(out), | |
| 35730 | - lookup_pshufb_improved<options & base64_url>(input0)); | ||
| 35742 | + lookup_pshufb_improved<isbase64url>(input0)); | ||
| 35731 | 35743 | out += 16; | |
| 35732 | 35744 | ||
| 35733 | 35745 | _mm_storeu_si128(reinterpret_cast<__m128i *>(out), | |
| 35734 | - lookup_pshufb_improved<options & base64_url>(input1)); | ||
| 35746 | + lookup_pshufb_improved<isbase64url>(input1)); | ||
| 35735 | 35747 | out += 16; | |
| 35736 | 35748 | ||
| 35737 | 35749 | _mm_storeu_si128(reinterpret_cast<__m128i *>(out), | |
| 35738 | - lookup_pshufb_improved<options & base64_url>(input2)); | ||
| 35750 | + lookup_pshufb_improved<isbase64url>(input2)); | ||
| 35739 | 35751 | out += 16; | |
| 35740 | 35752 | ||
| 35741 | 35753 | _mm_storeu_si128(reinterpret_cast<__m128i *>(out), | |
| 35742 | - lookup_pshufb_improved<options & base64_url>(input3)); | ||
| 35754 | + lookup_pshufb_improved<isbase64url>(input3)); | ||
| 35743 | 35755 | out += 16; | |
| 35744 | 35756 | } | |
| 35745 | 35757 | for (; i + 16 <= srclen; i += 12) { | |
@@ -35779,7 +35791,7 @@ size_t encode_base64(char *dst, const char *src, size_t srclen) { | |||
| 35779 | 35791 | const __m128i indices = _mm_or_si128(t1, t3); | |
| 35780 | 35792 | ||
| 35781 | 35793 | _mm_storeu_si128(reinterpret_cast<__m128i *>(out), | |
| 35782 | - lookup_pshufb_improved<options & base64_url>(indices)); | ||
| 35794 | + lookup_pshufb_improved<isbase64url>(indices)); | ||
| 35783 | 35795 | out += 16; | |
| 35784 | 35796 | } | |
| 35785 | 35797 | ||
@@ -38555,10 +38567,10 @@ simdutf_warn_unused size_t implementation::base64_length_from_binary(size_t leng | |||
| 38555 | 38567 | } | |
| 38556 | 38568 | ||
| 38557 | 38569 | size_t implementation::binary_to_base64(const char * input, size_t length, char* output, base64_options options) const noexcept { | |
| 38558 | - if(options == base64_url) { | ||
| 38559 | - return encode_base64<base64_url>(output, input, length); | ||
| 38570 | + if(options & base64_url) { | ||
| 38571 | + return encode_base64<true>(output, input, length, options); | ||
| 38560 | 38572 | } else { | |
| 38561 | - return encode_base64<base64_default>(output, input, length); | ||
| 38573 | + return encode_base64<false>(output, input, length, options); | ||
| 38562 | 38574 | } | |
| 38563 | 38575 | } | |
| 38564 | 38576 | } // namespace westmere | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - /* auto-generated on 2024-05-07 22:33:11 -0400. Do not edit! */ | ||
| 1 | + /* auto-generated on 2024-07-11 00:01:58 -0400. Do not edit! */ | ||
| 2 | 2 | /* begin file include/simdutf.h */ | |
| 3 | 3 | #ifndef SIMDUTF_H | |
| 4 | 4 | #define SIMDUTF_H | |
@@ -594,7 +594,7 @@ SIMDUTF_DISABLE_UNDESIRED_WARNINGS | |||
| 594 | 594 | #define SIMDUTF_SIMDUTF_VERSION_H | |
| 595 | 595 | ||
| 596 | 596 | /** The version of simdutf being used (major.minor.revision) */ | |
| 597 | - #define SIMDUTF_VERSION "5.2.8" | ||
| 597 | + #define SIMDUTF_VERSION "5.3.0" | ||
| 598 | 598 | ||
| 599 | 599 | namespace simdutf { | |
| 600 | 600 | enum { | |
@@ -605,11 +605,11 @@ enum { | |||
| 605 | 605 | /** | |
| 606 | 606 | * The minor version (major.MINOR.revision) of simdutf being used. | |
| 607 | 607 | */ | |
| 608 | - SIMDUTF_VERSION_MINOR = 2, | ||
| 608 | + SIMDUTF_VERSION_MINOR = 3, | ||
| 609 | 609 | /** | |
| 610 | 610 | * The revision (major.minor.REVISION) of simdutf being used. | |
| 611 | 611 | */ | |
| 612 | - SIMDUTF_VERSION_REVISION = 8 | ||
| 612 | + SIMDUTF_VERSION_REVISION = 0 | ||
| 613 | 613 | }; | |
| 614 | 614 | } // namespace simdutf | |
| 615 | 615 | ||
@@ -2300,9 +2300,13 @@ simdutf_warn_unused size_t trim_partial_utf16(const char16_t* input, size_t leng | |||
| 2300 | 2300 | ||
| 2301 | 2301 | // base64_options are used to specify the base64 encoding options. | |
| 2302 | 2302 | using base64_options = uint64_t; | |
| 2303 | + using base64_options = uint64_t; | ||
| 2303 | 2304 | enum : base64_options { | |
| 2304 | - base64_default = 0, /* standard base64 format */ | ||
| 2305 | - base64_url = 1 /* base64url format*/ | ||
| 2305 | + base64_default = 0, /* standard base64 format (with padding) */ | ||
| 2306 | + base64_url = 1, /* base64url format (no padding) */ | ||
| 2307 | + base64_reverse_padding = 2, /* modifier for base64_default and base64_url */ | ||
| 2308 | + base64_default_no_padding = base64_default | base64_reverse_padding, /* standard base64 format without padding */ | ||
| 2309 | + base64_url_with_padding = base64_url | base64_reverse_padding, /* base64url with padding */ | ||
| 2306 | 2310 | }; | |
| 2307 | 2311 | ||
| 2308 | 2312 | /** | |
@@ -2345,6 +2349,12 @@ simdutf_warn_unused size_t maximal_binary_length_from_base64(const char16_t * in | |||
| 2345 | 2349 | * where the invalid character was found. When the error is BASE64_INPUT_REMAINDER, then | |
| 2346 | 2350 | * r.count contains the number of bytes decoded. | |
| 2347 | 2351 | * | |
| 2352 | + * The default option (simdutf::base64_default) expects the characters `+` and `/` as part of its alphabet. | ||
| 2353 | + * The URL option (simdutf::base64_url) expects the characters `-` and `_` as part of its alphabet. | ||
| 2354 | + * | ||
| 2355 | + * The padding (`=`) is validated if present. There may be at most two padding characters at the end of the input. | ||
| 2356 | + * If there are any padding characters, the total number of characters (excluding spaces but including padding characters) must be divisible by four. | ||
| 2357 | + * | ||
| 2348 | 2358 | * You should call this function with a buffer that is at least maximal_binary_length_from_base64(input, length) bytes long. | |
| 2349 | 2359 | * If you fail to provide that much space, the function may cause a buffer overflow. | |
| 2350 | 2360 | * | |
@@ -2365,8 +2375,13 @@ simdutf_warn_unused result base64_to_binary(const char * input, size_t length, c | |||
| 2365 | 2375 | simdutf_warn_unused size_t base64_length_from_binary(size_t length, base64_options options = base64_default) noexcept; | |
| 2366 | 2376 | ||
| 2367 | 2377 | /** | |
| 2368 | - * Convert a binary input to a base64 ouput. The output is always padded with equal signs so that it is | ||
| 2369 | - * a multiple of 4 bytes long. | ||
| 2378 | + * Convert a binary input to a base64 ouput. | ||
| 2379 | + * | ||
| 2380 | + * The default option (simdutf::base64_default) uses the characters `+` and `/` as part of its alphabet. | ||
| 2381 | + * Further, it adds padding (`=`) at the end of the output to ensure that the output length is a multiple of four. | ||
| 2382 | + * | ||
| 2383 | + * The URL option (simdutf::base64_url) uses the characters `-` and `_` as part of its alphabet. No padding | ||
| 2384 | + * is added at the end of the output. | ||
| 2370 | 2385 | * | |
| 2371 | 2386 | * This function always succeeds. | |
| 2372 | 2387 | * | |
@@ -2396,6 +2411,12 @@ size_t binary_to_base64(const char * input, size_t length, char* output, base64_ | |||
| 2396 | 2411 | * where the invalid character was found. When the error is BASE64_INPUT_REMAINDER, then | |
| 2397 | 2412 | * r.count contains the number of bytes decoded. | |
| 2398 | 2413 | * | |
| 2414 | + * The default option (simdutf::base64_default) expects the characters `+` and `/` as part of its alphabet. | ||
| 2415 | + * The URL option (simdutf::base64_url) expects the characters `-` and `_` as part of its alphabet. | ||
| 2416 | + * | ||
| 2417 | + * The padding (`=`) is validated if present. There may be at most two padding characters at the end of the input. | ||
| 2418 | + * If there are any padding characters, the total number of characters (excluding spaces but including padding characters) must be divisible by four. | ||
| 2419 | + * | ||
| 2399 | 2420 | * You should call this function with a buffer that is at least maximal_binary_length_from_utf6_base64(input, length) bytes long. | |
| 2400 | 2421 | * If you fail to provide that much space, the function may cause a buffer overflow. | |
| 2401 | 2422 | * | |
@@ -2429,6 +2450,12 @@ simdutf_warn_unused result base64_to_binary(const char16_t * input, size_t lengt | |||
| 2429 | 2450 | * where the invalid character was found. When the error is BASE64_INPUT_REMAINDER, then | |
| 2430 | 2451 | * r.count contains the number of bytes decoded. | |
| 2431 | 2452 | * | |
| 2453 | + * The default option (simdutf::base64_default) expects the characters `+` and `/` as part of its alphabet. | ||
| 2454 | + * The URL option (simdutf::base64_url) expects the characters `-` and `_` as part of its alphabet. | ||
| 2455 | + * | ||
| 2456 | + * The padding (`=`) is validated if present. There may be at most two padding characters at the end of the input. | ||
| 2457 | + * If there are any padding characters, the total number of characters (excluding spaces but including padding characters) must be divisible by four. | ||
| 2458 | + * | ||
| 2432 | 2459 | * The INVALID_BASE64_CHARACTER cases are considered fatal and you are expected to discard | |
| 2433 | 2460 | * the output. | |
| 2434 | 2461 | * | |
@@ -3590,8 +3617,13 @@ class implementation { | |||
| 3590 | 3617 | simdutf_warn_unused virtual size_t base64_length_from_binary(size_t length, base64_options options = base64_default) const noexcept = 0; | |
| 3591 | 3618 | ||
| 3592 | 3619 | /** | |
| 3593 | - * Convert a binary input to a base64 ouput. The output is always padded with equal signs so that it is | ||
| 3594 | - * a multiple of 4 bytes long. | ||
| 3620 | + * Convert a binary input to a base64 ouput. | ||
| 3621 | + * | ||
| 3622 | + * The default option (simdutf::base64_default) uses the characters `+` and `/` as part of its alphabet. | ||
| 3623 | + * Further, it adds padding (`=`) at the end of the output to ensure that the output length is a multiple of four. | ||
| 3624 | + * | ||
| 3625 | + * The URL option (simdutf::base64_url) uses the characters `-` and `_` as part of its alphabet. No padding | ||
| 3626 | + * is added at the end of the output. | ||
| 3595 | 3627 | * | |
| 3596 | 3628 | * This function always succeeds. | |
| 3597 | 3629 | * | |
| Back | FazBrowse Home | New Git URL |
0 commit comments