diff options
author | agorodilov <agorodilov@yandex-team.ru> | 2022-02-10 16:47:09 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:09 +0300 |
commit | bd5ef432f5cfb1e18851381329d94665a4c22470 (patch) | |
tree | b83306b6e37edeea782e9eed673d89286c4fef35 /library/cpp/string_utils | |
parent | 7a4979e6211c3e78c7f9041d4a9e5d3405343c36 (diff) | |
download | ydb-bd5ef432f5cfb1e18851381329d94665a4c22470.tar.gz |
Restoring authorship annotation for <agorodilov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/string_utils')
-rw-r--r-- | library/cpp/string_utils/base64/base64.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/library/cpp/string_utils/base64/base64.cpp b/library/cpp/string_utils/base64/base64.cpp index 154da5d1f6..05c201f0de 100644 --- a/library/cpp/string_utils/base64/base64.cpp +++ b/library/cpp/string_utils/base64/base64.cpp @@ -92,9 +92,9 @@ static const char base64_bkw[] = { static_assert(Y_ARRAY_SIZE(base64_bkw) == 256, "wrong size"); -// Base64 for url encoding, RFC3548 +// Base64 for url encoding, RFC3548 static const char base64_etab_url[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; - + static inline unsigned char GetBase64EncodedIndex0(unsigned char octet0) { return (octet0 >> 2); } @@ -115,7 +115,7 @@ template <bool urlVersion> static inline char* Base64EncodeImpl(char* outstr, const unsigned char* instr, size_t len) { const char* const base64_etab = (urlVersion ? base64_etab_url : base64_etab_std); const char pad = (urlVersion ? ',' : '='); - + size_t idx = 0; while (idx + 2 < len) { @@ -140,15 +140,15 @@ static inline char* Base64EncodeImpl(char* outstr, const unsigned char* instr, s return outstr; } - + static char* Base64EncodePlain(char* outstr, const unsigned char* instr, size_t len) { return Base64EncodeImpl<false>(outstr, instr, len); -} - +} + char* Base64EncodeUrl(char* outstr, const unsigned char* instr, size_t len) { return Base64EncodeImpl<true>(outstr, instr, len); -} - +} + inline void uudecode_1(char* dst, unsigned char* src) { dst[0] = char((base64_bkw[src[0]] << 2) | (base64_bkw[src[1]] >> 4)); dst[1] = char((base64_bkw[src[1]] << 4) | (base64_bkw[src[2]] >> 2)); |