[core] Document base64_decode_quad_ input requirements

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
J. Nick Koston
2026-02-20 00:08:58 -06:00
parent af4d4b35ae
commit cdc40101d4

View File

@@ -589,7 +589,8 @@ size_t base64_decode(const std::string &encoded_string, uint8_t *buf, size_t buf
return base64_decode(reinterpret_cast<const uint8_t *>(encoded_string.data()), encoded_string.size(), buf, buf_len);
}
// Decode 4 base64 characters to up to 'count' output bytes, returns true if truncated
// Decode 4 base64 characters to up to 'count' output bytes, returns true if truncated.
// char_array_4 entries must be valid base64/base64url characters or 0 (zero-padding from tail).
static inline bool base64_decode_quad_(uint8_t *char_array_4, int count, uint8_t *buf, size_t buf_len, size_t &out) {
for (int i = 0; i < 4; i++)
char_array_4[i] = base64_find_char(char_array_4[i]);