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

Method Decode

encoding/base64.cpp:46–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46bool Base64::Decode(const StringPiece& input, std::string* output)
47{
48 std::string temp;
49 temp.resize(modp_b64_decode_len(input.size()));
50
51 // does not null terminate result since result is binary data!
52 int input_size = static_cast<int>(input.size());
53 int output_size = modp_b64_decode(&(temp[0]), input.data(), input_size);
54 if (output_size < 0)
55 return false;
56
57 temp.resize(output_size);
58 output->swap(temp);
59 return true;
60}
61
62bool Base64::WebSafeDecode(const StringPiece& input, std::string* output)
63{

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