MCPcopy Create free account
hub / github.com/apple/foundationdb / decodedLength

Function decodedLength

fdbrpc/Base64UrlDecode.cpp:101–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101int decodedLength(int codeLength) noexcept {
102 const auto r = (codeLength & 3);
103 if (r == 1)
104 return -1;
105 else if (r == 0)
106 return (codeLength / 4) * 3;
107 else
108 return (codeLength / 4) * 3 + (r - 1);
109}
110
111Optional<StringRef> decode(Arena& arena, StringRef base64UrlStr) {
112 auto decodedLen = decodedLength(base64UrlStr.size());

Callers 1

decodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected