You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* This function follows the WHATWG forgiving-base64 format, which means that it will
2304
+
* ignore any ASCII spaces in the input. You may provide a padded input (with one or two
2305
+
* equal signs at the end) or an unpadded input (without any equal signs at the end).
2306
+
*
2307
+
* See https://infra.spec.whatwg.org/#forgiving-base64-decode
2308
+
*
2309
+
* This function will fail in case of invalid input. There are two possible reasons for
2310
+
* failure: the input is contains a number of base64 characters that when divided by 4, leaves
2311
+
* a singler remainder character (BASE64_INPUT_REMAINDER), or the input contains a character
2312
+
* that is not a valid base64 character (INVALID_BASE64_CHARACTER).
2313
+
*
2314
+
* You should call this function with a buffer that is at least maximal_binary_length_from_base64(input, length) bytes long.
2315
+
* If you fail to provide that much space, the function may cause a buffer overflow.
2316
+
*
2317
+
* @param input the base64 string to process
2318
+
* @param length the length of the string in bytes
2319
+
* @param output the pointer to buffer that can hold the conversion result (should be at least maximal_binary_length_from_base64(input, length) bytes long).
2320
+
* @return a result pair struct (of type simdutf::error containing the two fields error and count) with an error code and either position of the error (in the input in bytes) if any, or the number of bytes written if successful.
2321
+
*/
2322
+
simdutf_warn_unused result base64_to_binary(constchar * input, size_t length, char* output) noexcept;
2323
+
2324
+
/**
2325
+
* Provide the base64 length in bytes given the length of a binary input.
* This function follows the WHATWG forgiving-base64 format, which means that it will
3420
+
* ignore any ASCII spaces in the input. You may provide a padded input (with one or two
3421
+
* equal signs at the end) or an unpadded input (without any equal signs at the end).
3422
+
*
3423
+
* See https://infra.spec.whatwg.org/#forgiving-base64-decode
3424
+
*
3425
+
* This function will fail in case of invalid input. There are two possible reasons for
3426
+
* failure: the input is contains a number of base64 characters that when divided by 4, leaves
3427
+
* a singler remainder character (BASE64_INPUT_REMAINDER), or the input contains a character
3428
+
* that is not a valid base64 character (INVALID_BASE64_CHARACTER).
3429
+
*
3430
+
* You should call this function with a buffer that is at least maximal_binary_length_from_base64(input, length) bytes long.
3431
+
* If you fail to provide that much space, the function may cause a buffer overflow.
3432
+
*
3433
+
* @param input the base64 string to process
3434
+
* @param length the length of the string in bytes
3435
+
* @param output the pointer to buffer that can hold the conversion result (should be at least maximal_binary_length_from_base64(input, length) bytes long).
3436
+
* @return a result pair struct (of type simdutf::error containing the two fields error and count) with an error code and either position of the error (in the input in bytes) if any, or the number of bytes written if successful.
0 commit comments