MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / FromBase64

Method FromBase64

src/engine/hint.cpp:37–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37SegmentHint SegmentHint::FromBase64(const std::string &base64Hint)
38{
39 BOOST_ASSERT_MSG(base64Hint.size() == ENCODED_SEGMENT_HINT_SIZE, "Hint has invalid size");
40
41 // We need mutability but don't want to change the API
42 auto encoded = base64Hint;
43
44 // Reverses above encoding we need for GET parameters in URL
45 std::replace(begin(encoded), end(encoded), '-', '+');
46 std::replace(begin(encoded), end(encoded), '_', '/');
47
48 return decodeBase64Bytewise<SegmentHint>(encoded);
49}
50
51bool operator==(const SegmentHint &lhs, const SegmentHint &rhs)
52{

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected