MCPcopy Create free account
hub / github.com/apache/trafficserver / Decode

Method Decode

src/cripts/Crypto.cc:47–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47cripts::string
48Crypto::Base64::Decode(cripts::string_view str)
49{
50 cripts::string ret;
51 size_t decoded_len = 0;
52
53 ret.resize(DECODED_LEN(str.size())); // Don't use reserve() here, or bad things happens.
54 if (TS_SUCCESS !=
55 TSBase64Decode(str.data(), str.size(), reinterpret_cast<unsigned char *>(ret.data()), ret.capacity(), &decoded_len)) {
56 ret = "";
57 } else {
58 ret.resize(decoded_len);
59 }
60
61 return ret; // RVO
62}
63
64cripts::string
65Crypto::Escape::Encode(cripts::string_view str)

Callers

nothing calls this directly

Calls 6

TSBase64DecodeFunction · 0.85
TSStringPercentDecodeFunction · 0.85
resizeMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45
capacityMethod · 0.45

Tested by

no test coverage detected