diff options
author | stanly <stanly@yandex-team.ru> | 2022-02-10 16:46:49 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:49 +0300 |
commit | 6170310e8721e225f64ddabf7a7358253d7a1249 (patch) | |
tree | 49e222ea1c5804306084bb3ae065bb702625360f /library/cpp/string_utils/base64 | |
parent | cde218e65dfef5ce03a48d641fd8f7913cf17b2d (diff) | |
download | ydb-6170310e8721e225f64ddabf7a7358253d7a1249.tar.gz |
Restoring authorship annotation for <stanly@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/string_utils/base64')
-rw-r--r-- | library/cpp/string_utils/base64/base64.cpp | 14 | ||||
-rw-r--r-- | library/cpp/string_utils/base64/base64.h | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/library/cpp/string_utils/base64/base64.cpp b/library/cpp/string_utils/base64/base64.cpp index 92060ad00f..05c201f0de 100644 --- a/library/cpp/string_utils/base64/base64.cpp +++ b/library/cpp/string_utils/base64/base64.cpp @@ -246,14 +246,14 @@ size_t Base64Decode(void* dst, const char* b, const char* e) { } TString Base64DecodeUneven(const TStringBuf s) { - if (s.length() % 4 == 0) { - return Base64Decode(s); - } - - // padding to 4 + if (s.length() % 4 == 0) { + return Base64Decode(s); + } + + // padding to 4 return Base64Decode(TString(s) + TString(4 - (s.length() % 4), '=')); -} - +} + char* Base64Encode(char* outstr, const unsigned char* instr, size_t len) { static const TImpl IMPL = GetImpl(); if (Y_LIKELY(len < 8)) { diff --git a/library/cpp/string_utils/base64/base64.h b/library/cpp/string_utils/base64/base64.h index 7941dd4d03..f778a6425a 100644 --- a/library/cpp/string_utils/base64/base64.h +++ b/library/cpp/string_utils/base64/base64.h @@ -88,9 +88,9 @@ inline TString Base64StrictDecode(const TStringBuf src) { } /// @} -/// Works with strings which length is not divisible by 4. +/// Works with strings which length is not divisible by 4. TString Base64DecodeUneven(const TStringBuf s); - + //encode constexpr size_t Base64EncodeBufSize(const size_t len) noexcept { return (len + 2) / 3 * 4 + 1; |