MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / base64Encode

Function base64Encode

src/Common/Base64.cpp:13–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11{
12
13std::string base64Encode(const std::string & decoded, bool url_encoding, bool no_padding)
14{
15 std::ostringstream ostr; // STYLE_CHECK_ALLOW_STD_STRING_STREAM
16 ostr.exceptions(std::ios::failbit);
17 auto options = (url_encoding ? Poco::BASE64_URL_ENCODING : 0)
18 | (no_padding ? Poco::BASE64_NO_PADDING : 0);
19 Poco::Base64Encoder encoder(ostr, options);
20 encoder.rdbuf()->setLineLength(0);
21 encoder << decoded;
22 encoder.close();
23 return ostr.str();
24}
25
26std::string base64Decode(const std::string & encoded, bool url_encoding, bool no_padding)
27{

Callers 14

consumeMethod · 0.85
generateMethod · 0.85
mutateMethod · 0.85
generateDigestMethod · 0.85
computeWebSocketAcceptFunction · 0.85
requestChallengeMethod · 0.85
formatJWSRequestDataMethod · 0.85
authenticateUserByHTTPFunction · 0.85
BSONElementAsJSONFunction · 0.85
fromRSAKeyMethod · 0.85
generateCSRFunction · 0.85
md5Function · 0.85

Calls 4

setLineLengthMethod · 0.45
rdbufMethod · 0.45
closeMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected