Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

Commit 0d99782

Browse files
committed
Use absl base64 codec in favor of our own
Signed-off-by: Otto van der Schaaf <[email protected]>
1 parent 8bffe0e commit 0d99782

File tree

6 files changed

+6
-309
lines changed

6 files changed

+6
-309
lines changed

pagespeed/kernel/base/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ cc_library(
182182
deps = [
183183
":gtest_prod",
184184
":pagespeed_base_core",
185-
"//third_party/base64",
186185
"@jsoncpp",
187186
],
188187
)

pagespeed/kernel/base/base64_util.h

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,37 +17,29 @@
1717
* under the License.
1818
*/
1919

20-
#ifndef PAGESPEED_KERNEL_BASE_BASE64_UTIL_H_
21-
#define PAGESPEED_KERNEL_BASE_BASE64_UTIL_H_
20+
#pragma once
2221

2322
#include "pagespeed/kernel/base/string.h"
2423

25-
//#include "base/strings/string_piece.h"
2624
#include "pagespeed/kernel/base/string_util.h"
27-
#include "third_party/base64/base64.h"
25+
#include "absl/strings/escaping.h"
2826

2927
namespace net_instaweb {
3028

3129
inline void Web64Encode(const StringPiece& in, GoogleString* out) {
32-
*out = web64_encode(reinterpret_cast<const unsigned char*>(in.data()),
33-
in.size());
30+
*out = absl::WebSafeBase64Escape(in);
3431
}
3532

3633
inline bool Web64Decode(const StringPiece& in, GoogleString* out) {
37-
bool ret = web64_decode(in.as_string(), out);
38-
return ret;
34+
return absl::WebSafeBase64Unescape(in, out);
3935
}
4036

4137
inline void Mime64Encode(const StringPiece& in, GoogleString* out) {
42-
*out = base64_encode(reinterpret_cast<const unsigned char*>(in.data()),
43-
in.size());
38+
*out = absl::Base64Escape(in);
4439
}
4540

4641
inline bool Mime64Decode(const StringPiece& in, GoogleString* out) {
47-
bool ret = base64_decode(in.as_string(), out);
48-
return ret;
42+
return absl::Base64Unescape(in, out);
4943
}
5044

5145
} // namespace net_instaweb
52-
53-
#endif // PAGESPEED_KERNEL_BASE_BASE64_UTIL_H_

third_party/base64/BUILD

Lines changed: 0 additions & 12 deletions
This file was deleted.

third_party/base64/README.google

Lines changed: 0 additions & 36 deletions
This file was deleted.

third_party/base64/base64.cc

Lines changed: 0 additions & 195 deletions
This file was deleted.

third_party/base64/base64.h

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)