Lines Matching refs:base64
59 Binary Binary::fromBase64(const String& base64, bool* success) {
60 if (base64.isEmpty()) {
67 if (base64.length() % 4 != 0 || base64.length() + 4 < base64.length()) {
72 result.reserve(3 * base64.length() / 4);
75 for (size_t i = 0; i < base64.length(); i += 4) {
77 if (!DecodeByte(base64[i + 0]).To(&a)) return Binary::fromSpan(nullptr, 0);
78 if (!DecodeByte(base64[i + 1]).To(&b)) return Binary::fromSpan(nullptr, 0);
79 if (!DecodeByte(base64[i + 2]).To(&c)) {
81 if (i + 4 < base64.length() || base64[i + 2] != pad ||
82 base64[i + 3] != pad) {
86 if (!DecodeByte(base64[i + 3]).To(&d)) {
88 if (i + 4 < base64.length() || base64[i + 3] != pad) {
94 if (base64[i + 2] != '=') result.push_back((0xFF & (b << 4)) | (c >> 2));
95 if (base64[i + 3] != '=') result.push_back((0xFF & (c << 6)) | d);