diff options
author | tau0 <tau0@yandex-team.ru> | 2022-02-10 16:49:58 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:58 +0300 |
commit | 76d6945a463556af330ad01235c41bb742823e0e (patch) | |
tree | 8888ef731e5013b4d2f9de62ccd8053e7107664b /library/cpp/string_utils/base64/base64.h | |
parent | 5c9752479158f30423a691a606b83df9fcb86ff3 (diff) | |
download | ydb-76d6945a463556af330ad01235c41bb742823e0e.tar.gz |
Restoring authorship annotation for <tau0@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/string_utils/base64/base64.h')
-rw-r--r-- | library/cpp/string_utils/base64/base64.h | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/library/cpp/string_utils/base64/base64.h b/library/cpp/string_utils/base64/base64.h index f778a6425a..dc86da3ce0 100644 --- a/library/cpp/string_utils/base64/base64.h +++ b/library/cpp/string_utils/base64/base64.h @@ -39,55 +39,55 @@ inline TString Base64Decode(const TStringBuf s) { return ret; } -/// -/// @brief Decodes Base64 string with strict verification -/// of invalid symbols, also tries to decode Base64 string with padding -/// inside. -// -/// @throws Throws exceptions on inputs which contain invalid symbols -/// or incorrect padding. -/// @{ -/// -/// @param b a pointer to the beginning of base64 encoded string. -/// @param e a pointer to the end of base64 encoded string. -/// @param dst memory for writing output. -/// -/// @return Returns number of bytes decoded. -/// -size_t Base64StrictDecode(void* dst, const char* b, const char* e); - -/// -/// @param src a base64 encoded string. -/// @param dst an pointer to allocated memory -/// for writing result. -/// -/// @return Returns dst wrapped into TStringBuf. -/// +/// +/// @brief Decodes Base64 string with strict verification +/// of invalid symbols, also tries to decode Base64 string with padding +/// inside. +// +/// @throws Throws exceptions on inputs which contain invalid symbols +/// or incorrect padding. +/// @{ +/// +/// @param b a pointer to the beginning of base64 encoded string. +/// @param e a pointer to the end of base64 encoded string. +/// @param dst memory for writing output. +/// +/// @return Returns number of bytes decoded. +/// +size_t Base64StrictDecode(void* dst, const char* b, const char* e); + +/// +/// @param src a base64 encoded string. +/// @param dst an pointer to allocated memory +/// for writing result. +/// +/// @return Returns dst wrapped into TStringBuf. +/// inline TStringBuf Base64StrictDecode(const TStringBuf src, void* dst) { return TStringBuf((const char*)dst, Base64StrictDecode(dst, src.begin(), src.end())); -} - -/// -/// @param src a base64 encoded string. -/// @param dst a decoded string. -/// +} + +/// +/// @param src a base64 encoded string. +/// @param dst a decoded string. +/// inline void Base64StrictDecode(const TStringBuf src, TString& dst) { - dst.ReserveAndResize(Base64DecodeBufSize(src.size())); - dst.resize(Base64StrictDecode(src, dst.begin()).size()); -} - -/// -/// @param src a base64 encoded string. -/// -/// @returns a decoded string. -/// + dst.ReserveAndResize(Base64DecodeBufSize(src.size())); + dst.resize(Base64StrictDecode(src, dst.begin()).size()); +} + +/// +/// @param src a base64 encoded string. +/// +/// @returns a decoded string. +/// inline TString Base64StrictDecode(const TStringBuf src) { TString ret; - Base64StrictDecode(src, ret); - return ret; -} -/// @} - + Base64StrictDecode(src, ret); + return ret; +} +/// @} + /// Works with strings which length is not divisible by 4. TString Base64DecodeUneven(const TStringBuf s); |