Removed const string& (#1693)

This commit is contained in:
Muhammad 2023-07-26 08:22:22 +03:00 committed by GitHub
parent ca92e32d55
commit c1da9922eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 25 deletions

View File

@ -129,10 +129,12 @@ inline std::string base64Encode(string_view data,
}
/// Encode the string to base64 format with no padding.
DROGON_EXPORT std::string base64EncodeUnpadded(
const unsigned char *bytes_to_encode,
unsigned int in_len,
bool url_safe = false);
inline std::string base64EncodeUnpadded(const unsigned char *bytes_to_encode,
unsigned int in_len,
bool url_safe = false)
{
return base64Encode(bytes_to_encode, in_len, url_safe, false);
}
/// Encode the string to base64 format with no padding.
inline std::string base64EncodeUnpadded(string_view data, bool url_safe = false)

View File

@ -139,13 +139,6 @@ static inline bool isBase64(unsigned char c)
return false;
}
bool isInteger(const std::string &str)
{
for (auto c : str)
if (c < '0' || c > '9')
return false;
return true;
}
bool isInteger(string_view str)
{
for (auto c : str)
@ -154,13 +147,6 @@ bool isInteger(string_view str)
return true;
}
bool isBase64(const std::string &str)
{
for (auto c : str)
if (!isBase64(c))
return false;
return true;
}
bool isBase64(string_view str)
{
for (auto c : str)
@ -460,13 +446,6 @@ std::string base64Encode(const unsigned char *bytes_to_encode,
return ret;
}
std::string base64EncodeUnpadded(const unsigned char *bytes_to_encode,
unsigned int in_len,
bool url_safe)
{
return base64Encode(bytes_to_encode, in_len, url_safe, false);
}
std::vector<char> base64DecodeToVector(string_view encoded_string)
{
auto in_len = encoded_string.size();