aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/string_utils/base64/base64.h
diff options
context:
space:
mode:
authortau0 <tau0@yandex-team.ru>2022-02-10 16:49:58 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:49:58 +0300
commit66f1a2f0600877a21fcc76f83c52904a58425f78 (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/string_utils/base64/base64.h
parent76d6945a463556af330ad01235c41bb742823e0e (diff)
downloadydb-66f1a2f0600877a21fcc76f83c52904a58425f78.tar.gz
Restoring authorship annotation for <tau0@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/string_utils/base64/base64.h')
-rw-r--r--library/cpp/string_utils/base64/base64.h88
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 dc86da3ce0..f778a6425a 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);