MCPcopy Create free account
hub / github.com/Thalhammer/jwt-cpp / count_padding

Function count_padding

include/jwt-cpp/base.h:166–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164 };
165
166 inline padding count_padding(const std::string& base, const std::vector<std::string>& fills) {
167 for (const auto& fill : fills) {
168 if (base.size() < fill.size()) continue;
169 // Does the end of the input exactly match the fill pattern?
170 if (base.substr(base.size() - fill.size()) == fill) {
171 return padding{1, fill.length()} +
172 count_padding(base.substr(0, base.size() - fill.size()), fills);
173 }
174 }
175
176 return {};
177 }
178
179 inline std::string encode(const std::string& bin, const std::array<char, 64>& alphabet,
180 const std::string& fill) {

Callers 2

TESTFunction · 0.85
decodeFunction · 0.85

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.68