Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5046)

Unified Diff: chrome/browser/resources/cryptotoken/b64.js

Issue 2939273002: DO NOT SUBMIT: what chrome/browser/resources/ could eventually look like with clang-format (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/cryptotoken/b64.js
diff --git a/chrome/browser/resources/cryptotoken/b64.js b/chrome/browser/resources/cryptotoken/b64.js
index d3c1e805102f2423dc6c91b78375131ffd4eafdd..e4a26f5b2d793780ef080a3f8534b23cc51cd81a 100644
--- a/chrome/browser/resources/cryptotoken/b64.js
+++ b/chrome/browser/resources/cryptotoken/b64.js
@@ -4,7 +4,8 @@
// WebSafeBase64Escape and Unescape.
function B64_encode(bytes, opt_length) {
- if (!opt_length) opt_length = bytes.length;
+ if (!opt_length)
+ opt_length = bytes.length;
var b64out =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';
var result = '';
@@ -32,7 +33,8 @@ function B64_encode(bytes, opt_length) {
// Normal base64 encode; not websafe, including padding.
function base64_encode(bytes, opt_length) {
- if (!opt_length) opt_length = bytes.length;
+ if (!opt_length)
+ opt_length = bytes.length;
var b64out =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
var result = '';
@@ -55,18 +57,18 @@ function base64_encode(bytes, opt_length) {
var i = (accu >> (shift - 6)) & 63;
result += b64out.charAt(i);
}
- while (result.length % 4) result += '=';
+ while (result.length % 4)
+ result += '=';
return result;
}
-var B64_inmap =
-[
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0,
- 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 0, 0, 0, 0, 0, 0,
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 0, 0, 0, 64,
- 0, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 0, 0, 0, 0, 0
+var B64_inmap = [
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0,
+ 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 0, 0, 0, 0, 0, 0,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 0, 0, 0, 64,
+ 0, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
+ 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 0, 0, 0, 0, 0
];
function B64_decode(string) {
@@ -75,7 +77,8 @@ function B64_decode(string) {
var shift = 0;
for (var i = 0; i < string.length; ++i) {
var c = string.charCodeAt(i);
- if (c < 32 || c > 127 || !B64_inmap[c - 32]) return [];
+ if (c < 32 || c > 127 || !B64_inmap[c - 32])
+ return [];
accu <<= 6;
accu |= (B64_inmap[c - 32] - 1);
shift += 6;

Powered by Google App Engine
This is Rietveld 408576698