MCPcopy Create free account
hub / github.com/chen3feng/toft / WebSafeDecode

Method WebSafeDecode

encoding/base64.cpp:62–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62bool Base64::WebSafeDecode(const StringPiece& input, std::string* output)
63{
64 std::string temp;
65 temp.resize(modp_b64r_decode_len(input.size()));
66
67 // does not null terminate result since result is binary data!
68 int input_size = static_cast<int>(input.size());
69 int output_size = modp_b64r_decode(&(temp[0]), input.data(), input_size);
70 if (output_size < 0)
71 return false;
72
73 temp.resize(output_size);
74 output->swap(temp);
75 return true;
76}
77
78} // namespace toft

Callers

nothing calls this directly

Calls 4

resizeMethod · 0.80
dataMethod · 0.80
sizeMethod · 0.45
swapMethod · 0.45

Tested by

no test coverage detected