| 45 | } |
| 46 | |
| 47 | cripts::string |
| 48 | Crypto::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 | |
| 64 | cripts::string |
| 65 | Crypto::Escape::Encode(cripts::string_view str) |
nothing calls this directly
no test coverage detected